incremen.sh 1.0 KB

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