incremental.at 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2004, 2007, 2013-2014, 2016 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. mkdir structure
  20. echo x >structure/file
  21. # On Nextstep (and perhaps other 4.3BSD systems),
  22. # a newly created file's ctime isn't updated
  23. # until the next sync or stat operation on the file.
  24. ls -l structure/file >/dev/null
  25. # If the time of an initial backup and the creation time of a file contained
  26. # in that backup are the same, the file will be backed up again when an
  27. # incremental backup is done, because the incremental backup backs up
  28. # files created "on or after" the initial backup time. Without the sleep
  29. # command, behaviour of tar becomes variable, depending whether the system
  30. # clock ticked over to the next second between creating the file and
  31. # backing it up.
  32. sleep 1
  33. tar cf archive --listed=list structure
  34. tar cfv archive --listed=list structure
  35. echo separator
  36. # ReiserFS often offsets the timestamps of newly created files
  37. # 1 second to the past. Try to compensate for it, until a better
  38. # solution is found.
  39. sleep 2
  40. echo y >structure/file
  41. tar cfv archive --listed=list structure
  42. ],
  43. [0],
  44. [
  45. structure/
  46. separator
  47. structure/
  48. structure/file
  49. ],
  50. [],[],[],[gnu,oldgnu,posix])
  51. AT_CLEANUP