While writing yet another backup script using tar --listed-incremental, I found that there was no option to prevent archiving directories that had no changes. I see this as a problem because when doing an incremental backup of a system with 10's of thousands of directories, yet where only a few files have changed, all of the directories are archived. This makes for a huge incremental backup which is excessive and makes it difficult to identify what actually changed.

I did try some related options such as --newer-mtime=date and --atime-preserve={system,replace,}, but without success: all directories were always archived.

Eventually I settled on an external solution which really ought to be in tar. And that is to use --files-from=- and feed it with something like find <path> -newermt <date>.

I should note a related irritation. If the find found no files, tar would archive everything in the current directory. I understand that tar takes targets from the command line and, optionally from the --files-from argument, but there is no way to say to take files only from the --files-from argument.

Thanks,

Todd

Reply via email to