cd bkupdir/
plop@ubuntu:~/testtar/bkupdir$ tar -czv --no-check-device --one-file-system --preserve-permissions --same-owner --seek --ignore-failed-read --listed-incremental=../metadata . -f ../level0
tar: .: Directory is new
tar: ./dir1: Directory is new
tar: ./dir2: Directory is new
./
./dir1/
./dir2/
./dir1/file1
./dir2/file2
plop@ubuntu:~/testtar/bkupdir$ tar -czv --no-check-device --one-file-system --preserve-permissions --same-owner --seek --ignore-failed-read --listed-incremental=../metadata . -f ../level1
tar: ./dir2: Directory has been renamed from ‘./dir1’
./
./dir2/
Restore level0:
plop@ubuntu:~/testtar/bkupdir$ cd ..
plop@ubuntu:~/testtar$ mkdir restdir
plop@ubuntu:~/testtar$ cd restdir/
plop@ubuntu:~/testtar/restdir$ tar -xzv --incremental -f ../level0
./
./dir1/
./dir2/
./dir1/file1
./dir2/file2
Restore level1:
plop@ubuntu:~/testtar/restdir$ tar -xzv --incremental -f ../level1
./
tar: Cannot rename ‘./dir1’ to ‘./dir2’: Directory not empty
./dir2/
tar: Deleting ‘./dir2/file2’
tar: Exiting with failure status due to previous errors
After failed restore state:
plop@ubuntu:~/testtar/restdir$ ls dir1
file1
plop@ubuntu:~/testtar/restdir$ ls dir2
plop@ubuntu:~/testtar/restdir$
Reproducing with Tar for the error "Directory not empty":
setup:
plop@ ubuntu: ~/testtar$ mkdir bkupdir ubuntu: ~/testtar$ mkdir bkupdir/dir1 ubuntu: ~/testtar$ mkdir bkupdir/dir2 ubuntu: ~/testtar$ touch bkupdir/dir1/file1 ubuntu: ~/testtar$ touch bkupdir/dir2/file2
plop@
plop@
plop@
plop@
Backup level0 :
cd bkupdir/ ubuntu: ~/testtar/ bkupdir$ tar -czv --no-check-device --one-file-system --preserve- permissions --same-owner --seek --ignore- failed- read --listed- incremental= ../metadata . -f ../level0
plop@
tar: .: Directory is new
tar: ./dir1: Directory is new
tar: ./dir2: Directory is new
./
./dir1/
./dir2/
./dir1/file1
./dir2/file2
Removing and Renaming:
plop@ ubuntu: ~/testtar/ bkupdir$ rm -r dir2 ubuntu: ~/testtar/ bkupdir$ mv dir1/ dir2
plop@
Backup level1:
plop@ ubuntu: ~/testtar/ bkupdir$ tar -czv --no-check-device --one-file-system --preserve- permissions --same-owner --seek --ignore- failed- read --listed- incremental= ../metadata . -f ../level1
tar: ./dir2: Directory has been renamed from ‘./dir1’
./
./dir2/
Restore level0:
plop@ ubuntu: ~/testtar/ bkupdir$ cd .. ubuntu: ~/testtar$ mkdir restdir ubuntu: ~/testtar$ cd restdir/ ubuntu: ~/testtar/ restdir$ tar -xzv --incremental -f ../level0
plop@
plop@
plop@
./
./dir1/
./dir2/
./dir1/file1
./dir2/file2
Restore level1:
plop@ ubuntu: ~/testtar/ restdir$ tar -xzv --incremental -f ../level1
./
tar: Cannot rename ‘./dir1’ to ‘./dir2’: Directory not empty
./dir2/
tar: Deleting ‘./dir2/file2’
tar: Exiting with failure status due to previous errors
After failed restore state:
plop@ ubuntu: ~/testtar/ restdir$ ls dir1 ubuntu: ~/testtar/ restdir$ ls dir2 ubuntu: ~/testtar/ restdir$
file1
plop@
plop@