//View Tip #740
Similar Tips
» Pipe files to an archive
» Using tar with other compression formats
» network copy with ssh and tar
» bzip2 ssh copy and machine power off
» Untar multiple files in a directory

 

Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
The tar command can be used to make a quick incremental backup as follows:

tar -Pvuf backup.tar /home/user/username

This will backup the directory /home/user/username. If any changes are made to the files in this directory and the above command is run again, the files will be added/changed in the tar file. Deleted files are not removed from the archive.

An alternative method is to use find to get a list of files newer than the backup and add these to the tar using the '-r' (append) option.

find /home/user/username ! -type d -newer backup.tar -exec tar -rvf backup.tar {} \;


View Comments »




Comments 

Add your comment

Comments are currently disabled
No Comments

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit