Hello,
I'm almost finished with solving my "incrementals on vfat" problem.
Almost, because now I get an error and I need your advice ;-)
The situation is the following: I have hacked a little (it took just as
much as, practically, commenting a preprocessor "#else" :-) ) AMANDA's
sendsize.c and sendbackup.c, so that they pass all parameters to tar
now. By "all" I mean "--listed-incremental <file>", as well as
"--incremental --newer-mtime <time>". Of course, tar cannot process
both, so I set GNUTAR to point to a wrapper script
(/usr/local/bin/gtar-wrapper) and modified the gtar-wrapper script found
on ftp://gandalf... to check the directory argument, decide if it is a
vfat one or not, and then chop the corresponding unneeded options,
before passing them to tar:
$DEBUG $GTAR "$1" "$2" "$3" "$6" "$7" "$8" "$9" "${10}" "${11}" "${12}"
"${13}" "${14}" "${15}" "${16}"
(you see that options nr. 4 and 5 are missing, they are "chopped" ;-)
The idea is: vfat filesystems get the job done with "--incremental
--newer-mtime <time>", all others use "--listed-incremental <file>".
Everything works fine, tar gets the right options each time:
--- output of gtar-wrapper for /usr/local
gtar-wrapper: start: Mon Dec 11 03:58:52 CET 2000
gtar-wrapper: args: --create --directory /usr/local --listed-incremental
/var/lib/amanda/gnutar-lists/bacchus_usr_local_1.new --incremental
--newer-mtime 2000-12-08 1:37:28 GMT --sparse --one-file-system
--ignore-failed-read --totals --file - .
gtar-wrapper: directory: /usr/local
gtar-wrapper: file: -
gtar-wrapper: pre_real__usr_local not found so nothing special run
gtar-wrapper: running /bin/gtar --create --directory /usr/local
--listed-incremental
/var/lib/amanda/gnutar-lists/bacchus_usr_local_1.new --sparse
--one-file-system --ignore-failed-read --totals --file - .
gtar-wrapper: looking for post_real__usr_local
gtar-wrapper: post_real__usr_local not found so nothing special run
gtar-wrapper: end: Mon Dec 11 04:43:22 CET 2000
---
(notice the difference between the arguments for gtar-wrapper and
/bin/tar)
But then, tar spits an error:
--- AMANDA's mail output for /usr/local
/-- bacchus /usr/local lev 1 FAILED [/usr/local/bin/gtar-wrapper
returned 2]
sendbackup: start [bacchus:/usr/local level 1]
sendbackup: info BACKUP=/usr/local/bin/gtar-wrapper
sendbackup: info RECOVER_CMD=/usr/bin/gzip -dc
|/usr/local/bin/gtar-wrapper -f... -
sendbackup: info COMPRESS_SUFFIX=.gz
sendbackup: info end
? /bin/gtar: : Cannot stat: No such file or directory
? /bin/gtar: : Warning: Cannot stat: No such file or directory
| Total bytes written: 53729280 (51MB, 20kB/s)
? /bin/gtar: Error exit delayed from previous errors
sendbackup: error [/usr/local/bin/gtar-wrapper returned 2]
\--------
---
The problem is that tar says "cannot stat", sends error code 2, which is
returned by my gtar-wrapper (exit_code=$?) and (here begins the real
problem!) *nothing is written* to the holding disk (I had deliberately
no tape in the drive). tar has worked till the end, has calculated a
level 1 file of 51MB and this is not written because gtar-wrapper
returned 2! :-(
So the question is: how do I tell my gtar-wrapper to ignore "Cannot
stat" messages? Shall I do what AMANDA does, i.e. parse the output of
tar? Should I manipulate the return code from tar (e.g. set it always to
0), just to give AMANDA the impression that everything was O.K., so that
she accepts the output and writes it to disk/tape? Shall I patch tar
(this is version 1.13.18)? And generally, how should I handle this,
since I can see that everything is actually being computed correctly?
You see now, I'm really near the end of this odyssey and I am eager to
reach Ithaka...can you help with the last miles?
This is AMANDA 2.4.1p1 with the samba patches.
Thanks in advance (and of course: as soon as I get this working
reliably, I will post a resumee and the script!).
--
Regards
Chris Karakas
Don´t waste your cpu time - crack rc5: http://www.distributed.net