Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 5 down vote accepted

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.

share|improve this answer
Thanks, @iain! This looks like something that I'll be able to easily implement (at least for the short term). – Russell C Feb 9 '11 at 21:03
It looks like I'll either be using a system like this (a tad ugly and unreliable since it could miss some files if the last backup fails) or using the output of the CMS that we're thinking of implementing that will automagically generate a log with changed files that need backing up. – Russell C Feb 10 '11 at 16:17

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.

share|improve this answer
Ah, Sven! You followed me! My colleague claims to be a Linux guy (and seems to know a decent amount) but frequently says things that are very... questionable. The problem that I have is that I won't have a list of backed up files to reference. The size of a backup tape is fairly small compared to the amount of data we will be backing up (and taking offsite). Because of this, I only will have one copy and need to arbitrarily know what needs to be backed up (like what @iain has suggested). – Russell C Feb 9 '11 at 20:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.