Comment 2 for bug 1570304

Revision history for this message
Pierre-Arthur MATHIEU (pi3rra) wrote :

Reproducing with Tar for the error "Directory not empty":

setup:

  plop@ubuntu:~/testtar$ mkdir bkupdir
  plop@ubuntu:~/testtar$ mkdir bkupdir/dir1
  plop@ubuntu:~/testtar$ mkdir bkupdir/dir2
  plop@ubuntu:~/testtar$ touch bkupdir/dir1/file1
  plop@ubuntu:~/testtar$ touch bkupdir/dir2/file2

Backup level0 :

  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

Removing and Renaming:

  plop@ubuntu:~/testtar/bkupdir$ rm -r dir2
  plop@ubuntu:~/testtar/bkupdir$ mv dir1/ dir2

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 ..
  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$