-   Linux - Newbie (
-   -   tar --incremental OR tar --update , what to use ? (

crispyleif 02-19-2009 11:09 AM

tar --incremental OR tar --update , what to use ?
Yes, I know about rsync, and yes I know about find -mtime :)

I'm trying to learn the basics and I just can't make a decent backup script with tar that makes incremental backups, preserving everything.

Does anyone have a working example on tar incremental backups ?

billymayday 02-20-2009 07:51 PM

I seem to recall that using tar incremental and certain file attributes (SELinux perhaps?) simply doesn't work

What I do is touch a file, and use find to select files modified or created since the dat of that file, so something like


touch "$DEST"
find /home -daystart -newer $INCREMENT -type f -print0 | xargs -0 tar --selinux -rf "$DEST"

where $INCREMENT points to a file that was touched during my last weekly backup (this is a daily incremental) and $DEST is the destination tarball. I then zip the file once created. I touch the destination initially because I'm adding to it (-r) with tar, so it needs to exist.

All times are GMT -5. The time now is 06:14 PM.