LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 02-19-2009, 11:09 AM   #1
crispyleif
Member
 
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, 07:51 PM   #2
billymayday
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

Code:
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.
 
  


Reply


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 10 02-23-2008 05:40 AM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 02:53 AM
help with tar incremental alcor Linux - General 1 09-07-2006 10:21 AM
Incremental tar backups Pepe Linux - General 5 03-18-2002 03:31 AM


All times are GMT -5. The time now is 09:32 AM.

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