A
A
Akim2562019-05-25 23:21:44
linux
Akim256, 2019-05-25 23:21:44

How to create a snapshot file of a folder for incremental backup using tar?

The situation is this: you need to regularly back up the folder and sometimes restore it. I do this: tar --create --listed-incremental=snapshot_file --file "a.1.tar" /dir
get archivers:
a.0.tar (full archive)
a.1.tar (archive with changes), etc. .P.
Everything is well created until the folder is restored from the archives. After that, at the next backup, not an incremental backup is created with changes relative to the existing ones, but a full backup of the entire folder (which makes no sense, because the same data is in the previous archives). In this regard, the idea arose after restoration to form a snapshot_file of the restored folder, so that tar in the next backup would already save changes relative to it. Is it possible?
Or maybe there are other options to make a backup of changes after restoring the folder, and not a backup of the whole thing?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Akim256, 2019-05-26
@Akim256

Like this:
tar --extract --ignore-failed-read --preserve-permissions --listed-incremental=/dev/null --recursion --absolute-names --file "a.0.tar"
if I understand correctly , then -p = --preserve-permissions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question