Re: Backup Script
- From: noi <noi@xxxxxxxx>
- Date: Thu, 23 Feb 2006 20:28:45 GMT
On Wed, 22 Feb 2006 11:21:03 -0800, somenewb wrote this:
Hi,
I'm using Suse9.3 and I'm trying to script an automated backup of some
files during the night when there's no one in the office. The first think
I'm having a problem with is getting tar to exclude a directory (and
everything below). I would like to pull the info from a seperate file
(--exclude-from=) but I'm not sure of the syntax to use.
Here's an imaginary file tree:
foo/ (top of tree I need to back up)
foo/fooa1/fooa2/fooa3 (sub branch #1) foo/foob1/foob2/foob3 (sub branch
#2) foo/fooc1/fooc2/fooc3 (sub branch #3)
Now, supposing I want to backup everything under "foo" except branch #2.
What syntax to is use for file I'm using with tar switch
(--exclude-from=)? Will a line like "foob/" or "foob/*" (minus the
quotation marks) work?
Secondly, under the bash shell, how to I get my script to name the file
"<prefix><today's date>.tar?
Thanks for your help.
I've had trouble using globals in tar, ie, tar /foo/fooa1/* because that
still included the directory I listed as excluded but IIRC --wildcards or
--wildcards-match-slash work
tar --wildcards --exclude=/foo/foob1/foob2/* -zvcf backup`Tz1`.tgz
where Tz1 is a .bashrc function
Tz1 ()
{ # julian date timestamp, ie, 06054143023
echo $(date +%y%j%H%M%S)
}
A lot better than --backup=numbered
.
- References:
- Backup Script
- From: somenewb
- Backup Script
- Prev by Date: Re: Fedora vs Mandrake vs Suse : Gamer and Home use !?!
- Next by Date: Re: Google luser doesn't know how to post
- Previous by thread: Re: Backup Script
- Next by thread: ibm-acpi not working!
- Index(es):
Relevant Pages
|