[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
GNU tar fails to restore listed-incremental backup
From: |
Deweloper |
Subject: |
GNU tar fails to restore listed-incremental backup |
Date: |
Fri, 14 Feb 2020 10:09:22 +0100 |
Hi all,
I'm using GNU tar for incremental backup using --listed-incremental
option. Unfortunately there seems to be a problem with restoring such
backup if following operations are performed:
1. Rename directory d1 to d3
2. Rename directory d2 to d1
Backup created afterwards contains:
R./d2 T./d1
R./d1 T./d3
R./d2 T./d1
Restoring it fails with:
tar: Cannot rename './d2' to './d1': Directory not empty
tar: Exiting with failure status due to previous errors
Isn't the presence of the first "R./d2 T./d1" a result of a bug?
Or maybe I don't understand how to use --listed-incremental option?
Below comes a shell script which reproduces this problem.
I expect it should restore "test" directory, but instead it fails at
the last line with the error above.
Thanks for help
--
--------------------------------------------------
mkdir test test/d1 test/d2
echo f1 > test/d1/file.txt
echo f2 > test/d2/file.txt
tar -c -g backup.snar --totals -X exclude.list -C test . > backup0.tar
echo f3 > test/d2/file.txt
mv test/d1 test/d3
mv test/d2 test/d1
tar -c -g backup.snar --totals -X exclude.list -C test . > backup1.tar
rm -rf test
mkdir test
cd test
tar x -g /dev/null < ../backup0.tar
tar x -g /dev/null < ../backup1.tar
- GNU tar fails to restore listed-incremental backup,
Deweloper <=