incremen.sh 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #! /bin/sh
  2. # A directory older than the listed entry was skipped completely.
  3. . ./preset
  4. TAR_ARCHIVE_FORMATS="gnu oldgnu"
  5. . $srcdir/before
  6. set -e
  7. mkdir structure
  8. echo x >structure/file
  9. # On Nextstep (and perhaps other 4.3BSD systems),
  10. # a newly created file's ctime isn't updated
  11. # until the next sync or stat operation on the file.
  12. ls -l structure/file >/dev/null
  13. # If the time of an initial backup and the creation time of a file contained
  14. # in that backup are the same, the file will be backed up again when an
  15. # incremental backup is done, because the incremental backup backs up
  16. # files created `on or after' the initial backup time. Without the sleep
  17. # command, behaviour of tar becomes variable, depending whether the system
  18. # clock ticked over to the next second between creating the file and
  19. # backing it up.
  20. sleep 1
  21. tar cf archive --listed=list structure
  22. tar cfv archive --listed=list structure
  23. echo -----
  24. sleep 1
  25. echo y >structure/file
  26. tar cfv archive --listed=list structure
  27. out="\
  28. structure/
  29. -----
  30. structure/
  31. structure/file
  32. "
  33. . $srcdir/after