incremental backup using tar
Suppose I have done a full backup by using:
tar cvf backup.tar /home/toBackup Can someone please tell me the command to do an incremental backup? I read the manpage, but got confused with the -G -g -N options :-( Thanks a lot! |
What do you mean by incremental? You mean just backup the things that have changed?
If so, I'd just let it overwrite the backup.tar with the new one. |
Well, that works fine if you have a small-sized directory to backup, but if the full backup is something like a few GB files, and only a few MB get changed since then, I do not really want to tar the whole thing again. The more you need to backup, the worse this approach works.
That heavy weigh backup is not really my case though. I am just thinking how I can do it, given an extreme situation. |
Well, try sticking the -g/-G options in there to see if it works... ie: on a practice tar file...
|
You can use find to select only the files that are newer than the previous backup file.
Yves. |
Quote:
There is the '--compare option' to see if files in the tar are different from the file system. You could see what's different , e.g., new files on the system, yank out and delete the old files in the tar and then add the new ones. It ain't as straight forward as you're hoping it would be. 8-] Take a look at the [URL=http://rsync.samba.org]rsync.samba.org[/URL rsync] command. After you set up an initial backup directory using rsync, any time you use it again, it only copies files that have changed. rsync plus the tar --compare option would be a good place to start. Skip the man page and read the info file for tar. It has a tutorial walk-through that may benefit you. vls Updating my original statements. You can get incremental behavior from tar, just not the way you want it to or think how it works. If what you want to do is replace a file in a tar archive with a newer versioin, that just ain't happening. Not directly. You would need to do the compare delete , append route. With the --listed-incremental option, you can create a new archive containing only the new versions of of files in the archive that have changed on the file system. Of course I could be absolutely wrong, but I don't think I am. (not trying to be funny) |
Code:
# cd /place/to/backup |
Quote:
|
Performing incremental backups with tar:
find / -mtime -1 -type f -print This will give the files which have changed since the last 24 hours. So, we can back up only these files by means of the command tar cvf /dev/st0 'find / -mtime -1 -type f -print' |
Star can do incremental backups.
http://linux.softpedia.com/get/Syste...tar-1058.shtml Currently star is part of my distro. However when I looked at them man page of star here: http://linux.about.com/library/cmd/blcmdl1_star.htm there was no mention of an incremental option. The program in the first link does. I wonder whether it is the same version or that the man page is incomplete. Whatever, some time ago I switched to rsync to do backups. Even if you have a fast archive program, it takes a very long time before the one file you were looking for is located in the tar file. With rsync it is a matter of seconds. jlinkels |
All times are GMT -5. The time now is 01:55 PM. |