Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-19-2009, 12:09 PM   #1
Registered: Mar 2005
Location: Norway, by the coast
Distribution: Debian and the likes
Posts: 190

Rep: Reputation: 31
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 ?
Old 02-20-2009, 08:51 PM   #2
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 03:48 AM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 03:53 AM
help with tar incremental alcor Linux - General 1 09-07-2006 11:21 AM
Incremental tar backups Pepe Linux - General 5 03-18-2002 04:31 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:01 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration