incremental.at 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright (C) 2004, 2007 Free Software Foundation, Inc.
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 3, or (at your option)
  7. # any later version.
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. # You should have received a copy of the GNU General Public License
  13. # along with this program; if not, write to the Free Software
  14. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  15. # 02110-1301, USA.
  16. # A directory older than the listed entry was skipped completely.
  17. AT_SETUP([incremental])
  18. AT_KEYWORDS([incremental incr00])
  19. AT_TAR_CHECK([
  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