incr03.at 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2006-2007, 2009, 2013 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. # Description:
  16. # Previous versions checked only mtime/ctime of directories during
  17. # incremental backups. As a result, it sufficed to rename a single file
  18. # to get full dump of the directory where it resided. Since v.1.15.91
  19. # tar checks directory contents as well, so in this case only the renamed
  20. # file is dumped.
  21. AT_SETUP([renamed files in incrementals])
  22. AT_KEYWORDS([incremental incr03 rename])
  23. AT_TAR_CHECK([
  24. AT_SORT_PREREQ
  25. mkdir directory
  26. genfile --file=directory/x
  27. genfile --file=directory/y
  28. sleep 1
  29. tar -cf archive.1 -g db directory
  30. mv directory/x directory/z
  31. cp db db.old
  32. tar -cf archive.2 -g db directory
  33. mv directory orig
  34. echo Listing of archive.1
  35. tar -tf archive.1 | sort
  36. echo Listing of archive.2
  37. tar -tf archive.2 | sort
  38. echo Directory after first restore
  39. tar -xf archive.1 -g db --warning=no-timestamp
  40. find directory | sort
  41. echo Directory after second restore
  42. tar -xf archive.2 -g db --warning=no-timestamp
  43. find directory | sort
  44. ],
  45. [0],
  46. [Listing of archive.1
  47. directory/
  48. directory/x
  49. directory/y
  50. Listing of archive.2
  51. directory/
  52. directory/z
  53. Directory after first restore
  54. directory
  55. directory/x
  56. directory/y
  57. Directory after second restore
  58. directory
  59. directory/y
  60. directory/z
  61. ],[],[],[],[gnu, oldgnu, posix])
  62. AT_CLEANUP
  63. # End of incr03.at