Re-running the restore of the failed level seems to solve the "Directory not empty" error.
For example, assuming you follow the exact procedure described in the previous comment:
The first restore of level1 gives:
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
With this state:
plop@ubuntu:~/testtar/restdir$ ls dir1
file1
plop@ubuntu:~/testtar/restdir$ ls dir2
plop@ubuntu:~/testtar/restdir$
After re-running the restore a second time, we get:
plop@ubuntu:~/testtar/restdir$ tar -xzv --incremental -f ../level1
./
./dir2/
With this state:
plop@ubuntu:~/testtar/restdir$ ls dir1
ls: cannot access dir1: No such file or directory
plop@ubuntu:~/testtar/restdir$ ls dir2
file1
Re-running the restore of the failed level seems to solve the "Directory not empty" error.
For example, assuming you follow the exact procedure described in the previous comment:
The first restore of level1 gives:
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
With this state:
plop@ ubuntu: ~/testtar/ restdir$ ls dir1 ubuntu: ~/testtar/ restdir$ ls dir2 ubuntu: ~/testtar/ restdir$
file1
plop@
plop@
After re-running the restore a second time, we get:
plop@ ubuntu: ~/testtar/ restdir$ tar -xzv --incremental -f ../level1
./
./dir2/
With this state:
plop@ ubuntu: ~/testtar/ restdir$ ls dir1 ubuntu: ~/testtar/ restdir$ ls dir2
ls: cannot access dir1: No such file or directory
plop@
file1