listed01.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #! /bin/sh
  2. # Check if listed-incremental backups work for individual files.
  3. # Script proposed by Andreas Schuldei <[email protected]>
  4. # This file is part of GNU tar testsuite.
  5. # Copyright (C) 2004 Free Software Foundation, Inc.
  6. #
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2, or (at your option)
  10. # any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software
  19. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  20. # 02111-1307, USA.
  21. . ./preset
  22. TAR_ARCHIVE_FORMATS="gnu oldgnu"
  23. . $srcdir/before
  24. mkdir directory
  25. genfile --length 10240 --pattern zeros > directory/file1
  26. # Let the things settle
  27. sleep 1
  28. tar --create \
  29. --file=archive.1 \
  30. --listed-incremental=listing \
  31. directory/file*
  32. tar tf archive.1
  33. dd if=/dev/zero of=directory/file2 bs=1024 count=20 2>/dev/null
  34. echo "separator"
  35. tar --create \
  36. --file=archive.2 \
  37. --listed-incremental=listing \
  38. directory/file*
  39. tar tf archive.2
  40. out="\
  41. directory/file1
  42. separator
  43. directory/file2
  44. "
  45. . $srcdir/after