* Difficulty: Intermediate
* Application: tar
Want to use tar to backup only certain files in a directory? Then you'll want to use the -T flag as follows. First, create a file with the file you want to backup:
cat >> /etc/backup.conf
# /etc/passwd
# /etc/shadow
# /etc/yp.conf
# /etc/sysctl.conf
EOF
Then run tar with the -T flag pointing to the file just created:
tar -cjf bck-etc-`date +%Y-%m-%d`.tar.bz2 -T /etc/backup.conf
Now you have your backup.
source: http://www.linuxformat.co.uk/wiki/index.php/58_Cool_Hacks
STumbling In Linux Land, STupid and Unlucky Pablo? The tribulations and happy discoveries of a Linux former Newbie, now bit more experienced user
Showing posts with label Backup selected files only. Show all posts
Showing posts with label Backup selected files only. Show all posts
Sunday, February 1, 2009
Subscribe to:
Posts (Atom)