Tip #740 Incremental backup with tar
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 {} \;
- TAGS:
- tar
alias aptitude at awk bash bc cal cat cd colrm comm cp csh curl cut date dd df dialog diff dirname dpkg du fc find fuser grep gs gzip history iconv kill ksh last less ln ls lsof lynx m4 md5sum mkdir mkfifo mkisofs mv mysql nc netstat openssl OSX perl ping popd ps pushd python read redirection rm scp screen sed sort ssh stat sudo svn tail tar tee test top tr uniq vim wc wget xargs