listed01.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. . $srcdir/before gnu oldgnu
  23. mkdir directory
  24. dd if=/dev/zero of=directory/file1 bs=1024 count=10 2>/dev/null
  25. # Let the things settle
  26. sleep 1
  27. tar --create \
  28. --file=archive.1 \
  29. --listed-incremental=listing \
  30. directory/file*
  31. tar tf archive.1
  32. dd if=/dev/zero of=directory/file2 bs=1024 count=20 2>/dev/null
  33. echo "separator"
  34. tar --create \
  35. --file=archive.2 \
  36. --listed-incremental=listing \
  37. directory/file*
  38. tar tf archive.2
  39. out="\
  40. directory/file1
  41. separator
  42. directory/file2
  43. "
  44. . $srcdir/after