Hey people!
A recent accident with a mke2fs command on my /home partition has
caused me to try to implement some sort of backup procedure. Now I'm
a lazy forgetful <insert appropriate adjective>. So I figure tar... a
nice shell script... cron, and Bob's me Uncle.
All's well and good until I get to the part where I want to exclude a
few directories from the backup. You know things like
~/.netscape/cache and that sort of thing.
Anyway, the tar command as I have it in the script is...
,----[ excerpt from script ] [1]
| tar --create --verbose --bzip2 --file=$TARFILE\
| --exclude-from=$EXCLUDE --newer="$THEN"\
| $HOME > $RECORD 2>&1
`----
And the exclude file...
,----[ exclude file ]
| '${HOME}/download/*'
| '${HOME}/temp/*'
| '${HOME}/.autosave/*'
| '${HOME}/.netscape/cache/*'
| '${HOME}/.mozilla/steve-moz/Cache/*'
| '${HOME}/.w3/cache/*'
`----
Everything works great, except it doesn't exclude those directories.
I've tried everything that I can think of including putting all the
exclusions on the command line.
Mind you, this part of tar's info file worries me a tad...
,----[ info tar ]
| The main operating mode of `tar' will always act on file names
| listed on the command line, no matter whether or not there is an
| exclusion which would otherwise affect them. In the example
| above, if you create an archive and exclude files that end with
| `*.o', but explicitly name the file `catc.o' after all the options
| have been listed, `catc.o' _will_ be included in the archive.
`----
Does this mean that because I am explicitly naming a directory ($HOME)
I can't exclude other directories? Which to me, sounds absolutely
crazy.
Can anyone tell me how to get tar and _some_ of the feathers instead
of tar and _all_ the feathers?
Or, in other words, how can I tar my $HOME but not include _every_
sub-directory under $HOME ?
===========================
Want to really learn Linux?
... Install Slackware
===========================
Footnotes:
[1] Don't worry about the variables here, they're all ok. The script
works fine except it doesn't take any notice of the exclusions
--
|---<Regards, Steve Youngs>-------------------------------------|
| Failures are divided into two classes - those who thought and |
| never did, and those who did and never thought. |
|------------------------------------<[EMAIL PROTECTED]>---|