]> Dogcows Code - chaz/tar/blob - tests/listed02.sh
Added listed02.sh
[chaz/tar] / tests / listed02.sh
1 #! /bin/sh
2 # This file is part of GNU tar testsuite.
3 # Copyright (C) 2004 Free Software Foundation, Inc.
4 #
5 # This program 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 2, or (at your option)
8 # any later version.
9 #
10 # This program 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 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18 # 02111-1307, USA.
19
20 # Check if listed-incremental backups work for files moved from one directory
21 # to another.
22 # Based on a script by Martin Simmons <ZYHYLCRMZPRP@spammotel.com>
23 # References:
24 # <20040626230315.163AA1D148@cpc5-cmbg1-6-0-cust208.cmbg.cable.ntl.com>
25 # http://lists.gnu.org/archive/html/bug-tar/2004-06/msg00028.html
26
27 . ./preset
28 TAR_ARCHIVE_FORMATS="gnu oldgnu"
29 . $srcdir/before
30
31 mkdir directory
32
33 echo Create directories
34 mkdir tart
35 sleep 1
36 mkdir tart/c0
37 sleep 1
38 mkdir tart/c1
39 sleep 1
40
41 for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2
42 do
43 echo File $file > $file
44 sleep 1
45 done
46
47 sleep 1
48 echo Creating main archive
49 tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart
50
51 sleep 1
52 echo Modifying filesystem
53 rm tart/a1
54 mv tart/b1 tart/b2
55 mv tart/c1 tart/c2
56 touch tart/c2/ca3
57
58 echo Directory contents
59 find tart|sort
60
61 sleep 1
62 echo Creating incremental archive
63 cp -p tart.incr1 tart.incr2
64 tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart
65
66 sleep 1
67
68 rm -rf tart/*
69 echo Extracting main archive
70 tar -x -v --listed-incremental=tart.incr1 -f archive.1
71 echo Extracting incremental archive
72 tar -x -v --listed-incremental=tart.incr2 -f archive.2
73
74 echo Final files:
75 find tart|sort
76
77 err="tar: tart/c0: Directory is new
78 tar: tart/c1: Directory is new
79 tar: tart/c2: Directory is new
80 "
81
82 out="Create directories
83 Creating main archive
84 tart/
85 tart/c0/
86 tart/c1/
87 tart/a1
88 tart/b1
89 tart/c0/cq1
90 tart/c0/cq2
91 tart/c1/ca1
92 tart/c1/ca2
93 Modifying filesystem
94 Directory contents
95 tart
96 tart/b2
97 tart/c0
98 tart/c0/cq1
99 tart/c0/cq2
100 tart/c2
101 tart/c2/ca1
102 tart/c2/ca2
103 tart/c2/ca3
104 Creating incremental archive
105 tart/
106 tart/c0/
107 tart/c2/
108 tart/b2
109 tart/c2/ca1
110 tart/c2/ca2
111 tart/c2/ca3
112 Extracting main archive
113 tart/
114 tart/c0/
115 tart/c1/
116 tart/a1
117 tart/b1
118 tart/c0/cq1
119 tart/c0/cq2
120 tart/c1/ca1
121 tart/c1/ca2
122 Extracting incremental archive
123 tart/
124 tar: Deleting \`tart/c1'
125 tar: Deleting \`tart/a1'
126 tar: Deleting \`tart/b1'
127 tart/c0/
128 tart/c2/
129 tart/b2
130 tart/c2/ca1
131 tart/c2/ca2
132 tart/c2/ca3
133 Final files:
134 tart
135 tart/b2
136 tart/c0
137 tart/c0/cq1
138 tart/c0/cq2
139 tart/c2
140 tart/c2/ca1
141 tart/c2/ca2
142 tart/c2/ca3
143 "
144
145 . $srcdir/after
This page took 0.038391 seconds and 4 git commands to generate.