incr03.at 2.1 KB

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