incremental.at 2.1 KB

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