[Prev][Next][Index][Thread]
Re: How to backup an executor partition??
>>>>> "V" == Vincent Cojot <coyote@step.polymtl.ca> writes:
V> My command line looks like (it's a short example in which I am
V> trying to backup .../ExecutorVolume/Programs/Execl 4.0 to show the
V> problem):
V> palanthas:~$ tar --null -cvzf /tmp/test.tgz
V> /usr/local/lib/executor/ExecutorVolume/Programs/Ex*
As far as I can tell, this is not a problem with tar. I bet if you
issue the command
tar --null -cvzf /tmp/test.tgz \
/usr/local/lib/executor/ExecutorVolume/Programs
you'll have no problems. The problem you are having is not with tar,
but with file name expansion done by the shell. When you say
something like
somedir/Programs/Ex*
The shell expands it into soemthing like
somedir/Programs/Excel 4.0 SomeFile somedir/Programs/Excel 4.0 AnotherFile
and hands this to tar on its command line. Note that tar sees this
line as 6 files (listed below separated by newlines for clarity):
stuff/Programs/Excel
4.0
SomeFile
stuff/Programs/Excel
4.0
AnotherFile
using --null doesn't help here because the program feeding the names
to tar, the shell, isn't using null termination. I'm not even sure it
does what you want since --null is mostly meant for use with the
--files-from option.
So, how do you fix it? One option is to not use the shell for
filename expansion. Instead use find. You could get essentially the
same effect with find and tar like this:
find /usr/local/lib/executor/ExecutorVolume/Programs --name "Ex*" \
-print0 | tar --null --files-from - czf /tmp/test.tgz
I think that's right...
Anyway, good luck.
--
Rob