On reviewing it, I see I forgot to specify the directory to backup.
Solution 1: Omit the "-C", that only changes the directory
Disadvantage: the path will be in the backup
Solution 2: Do something like this
Code:
tar cvzf 2010-01-16_00-13_site-2.tgz -C /home/www site-1
You can use
dirname(1) to extract the path for "-C"
Code:
$ dirname /home/www/site-1
/home/www
$ basename home/www/site-1
site-1
I probably couldn't concentrate because of the memories of the brown eyes
Leaving out the "-C" option
Code:
# tar cvzf robert /home/robert
tar: Removing leading / from absolute path names in the archive
home/robert
home/robert/.cshrc
home/robert/.login
home/robert/.mailrc
home/robert/.profile
home/robert/Maildir
home/robert/Maildir/tmp
home/robert/Maildir/new
home/robert/Maildir/cur
home/robert/.exrc
Here the
home dir is stored.
Code:
tar cvzf robert -C /home robert
robert
robert/.cshrc
robert/.login
robert/.mailrc
robert/.profile
robert/Maildir
robert/Maildir/tmp
robert/Maildir/new
robert/Maildir/cur
robert/.exrc
Here only the "robert' directory name.