5

I'm working on a project where I'll be using tar to incrementally backup data on a server to a number of tapes. According to a senior co-worker of mine, tar will "set special flags on files so that it can tell if the files has been modified since last backup." I was never aware that tar could ever modify source files (other than deleting).
I've been having a heck of a time going though the GNU tar help page and the UNIX tar man page but I can not yet either verify or disprove what he said. So, is this complete bull and I'll have to use something like Bacula or can I do what he was explaining (and how)?
Cheers! Russell C

Russell C
  • 115

2 Answers2

8

Is your colleague a Windows guy? Because on Windows, there is the a (for archive) attribute which is set whenever a file is modified and is supposed to be cleared when a backup program backs it up.

On Unix/Linux, backup programs normally use the ctime/mtime values of a file do decide if they need to backup the file - if the time is newer than in the backup, save it.

You can tell tar to backup only files newer than the last backup with the -N or --newer option.

grawity
  • 17,092
Sven
  • 100,763
5

I don't think that tar will do that as the filesystems don't have "special flags". You can use the -N DATE or --newer DATE switch to backup files newer than DATE. You can use --newer-mtime DATE to backup files that have been modified since DATE. You can also use -g file or --listed-incremental=file to store meta data in an external file that can then be referenced for making incremental backups.

user9517
  • 117,122