4
0

incremental.at 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2004-2023 Free Software Foundation, Inc.
  4. # This file is part of GNU tar.
  5. # GNU tar is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 3 of the License, or
  8. # (at your option) any later version.
  9. # GNU tar is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. # A directory older than the listed entry was skipped completely.
  16. AT_SETUP([incremental])
  17. AT_KEYWORDS([incremental listed incr00])
  18. AT_TAR_CHECK([
  19. AT_CHECK_TIMESTAMP
  20. mkdir structure
  21. echo x >structure/file
  22. # On Nextstep (and perhaps other 4.3BSD systems),
  23. # a newly created file's ctime isn't updated
  24. # until the next sync or stat operation on the file.
  25. ls -l structure/file >/dev/null
  26. # If the time of an initial backup and the creation time of a file contained
  27. # in that backup are the same, the file will be backed up again when an
  28. # incremental backup is done, because the incremental backup backs up
  29. # files created "on or after" the initial backup time. Without the sleep
  30. # command, behaviour of tar becomes variable, depending whether the system
  31. # clock ticked over to the next second between creating the file and
  32. # backing it up.
  33. sleep 1
  34. tar cf archive --listed=list structure
  35. tar cfv archive --listed=list structure
  36. echo separator
  37. # ReiserFS often offsets the timestamps of newly created files
  38. # 1 second to the past. Try to compensate for it, until a better
  39. # solution is found.
  40. sleep 2
  41. echo y >structure/file
  42. tar cfv archive --listed=list structure
  43. ],
  44. [0],
  45. [
  46. structure/
  47. separator
  48. structure/
  49. structure/file
  50. ],
  51. [],[],[],[gnu,oldgnu,posix])
  52. AT_CLEANUP