2

I know I can perform progressive (incremental) backups with tar using snapshots, I am doing something like this for the directory I want to create a backup for:

tar cpf progressive.tar --listed-incremental=snapshot /home/user/dir

However, can I do differential backups with tar instead of progressive ones?

I know the --diff is used for this task, but it's not clear to me how to do the whole thing.

1 Answer 1

2

You cannot do automated differential backups with tar using the --diff operation mode. This is because the --diff operation mode will only look for differences between files already in the tar file and the files of the file system. If a file that resides in the tar file is missing in the file system tar will give you this message:

tar: etc/test.txt: Warning: Cannot stat: No such file or directory

If the content of a file already in the tar file gets changed, tar will print:

etc/test.txt: Mod time differs
etc/test.txt: Size differs

If there is a new file in the file system tar will give you no information. The same is true for the --update operation mode. It only checks for files already in the archiv.

I found some solutions for doing differential backups with tar using the --newer parameter relaying on date/time informations of the last full or differential backup. Other solutions stores metadata of the backups and doing differential backups using this metadata.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .