summaryrefslogtreecommitdiff
path: root/bugs/exclude_already_existing_files_in_backup__44___does_not_remove_them.mdwn
blob: 91a8ab455525b85fb6de5d6c61b9f04ff0d436fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
Obnam version 1.0

Host: Gentoo amd64

When excluding a file that already exists on the backup, the file is not removed from the last backup, but it is kept, without being updated.

The file excluded should not appear on generations created with the exclude filter.

How to reproduce:

	#############################################
	#!/bin/sh
	
	rm -rf /tmp/test
	mkdir -p /tmp/test/backup
	touch /tmp/test/backup/file1
	touch /tmp/test/backup/file2
	
	# 1st run, exclude file1
	# only file2 is present on backup
	obnam -r /tmp/test/repo --exclude=/tmp/test/backup/file1 backup /tmp/test/backup
	obnam -r /tmp/test/repo ls
	
	# 2nd run
	# none excluded, both files present on backup
	obnam -r /tmp/test/repo backup /tmp/test/backup
	obnam -r /tmp/test/repo ls
	
	# 3rd run, modify files and backup with exclude=file1
	# both files present, file2 is updated on backup, file1 is neither updated, or removed
	echo "000" > /tmp/test/backup/file1
	echo "000" > /tmp/test/backup/file2
	obnam -r /tmp/test/repo --exclude=/tmp/test/backup/file1 backup /tmp/test/backup
	obnam -r /tmp/test/repo ls
	
	cd /
	rm -rf /tmp/test/backup
	obnam -r /tmp/test/repo restore /tmp/test/backup
	ls -lha /tmp/test/backup
	#############################################
 
OUTPUT:

	+ rm -rf /tmp/test
	+ mkdir -p /tmp/test/backup
	+ touch /tmp/test/backup/file1
	+ touch /tmp/test/backup/file2
	
	# 1st run, exclude file1
	# only file2 is present on backup
	+ obnam -r /tmp/test/repo --exclude=/tmp/test/backup/file1 backup /tmp/test/backup
	Backed up 2 files, uploaded 0.0 B in 0s at 0.0 B/s average speed
	+ obnam -r /tmp/test/repo ls
	Generation 2 (2012-06-20 09:23:41 - 2012-06-20 09:23:41)
	drwxr-xr-x    24 root     root           4096 2012-06-20 05:27:42 /
	drwxrwxrwx    19 root     root            480 2012-06-20 07:23:40 /tmp
	drwxrwx---     4 jordi    jordi            80 2012-06-20 07:23:41 /tmp/test
	drwxrwx---     2 jordi    jordi            80 2012-06-20 07:23:40 /tmp/test/backup
	-rw-rw----     1 jordi    jordi             0 2012-06-20 07:23:40 /tmp/test/backup/file2
	
	# 2nd run
	# none excluded, both files present on backup
	+ obnam -r /tmp/test/repo backup /tmp/test/backup
	Backed up 3 files, uploaded 0.0 B in 0s at 0.0 B/s average speed
	+ obnam -r /tmp/test/repo ls
	Generation 5 (2012-06-20 09:23:41 - 2012-06-20 09:23:41)
	drwxr-xr-x    24 root     root           4096 2012-06-20 05:27:42 /
	drwxrwxrwx    19 root     root            480 2012-06-20 07:23:40 /tmp
	drwxrwx---     4 jordi    jordi            80 2012-06-20 07:23:41 /tmp/test
	drwxrwx---     2 jordi    jordi            80 2012-06-20 07:23:40 /tmp/test/backup
	-rw-rw----     1 jordi    jordi             0 2012-06-20 07:23:40 /tmp/test/backup/file1
	-rw-rw----     1 jordi    jordi             0 2012-06-20 07:23:40 /tmp/test/backup/file2
	
	# 3rd run, modify files and backup with exclude=file1
	# both files present, file2 is updated on backup, file1 is neither updated, or removed
	+ obnam -r /tmp/test/repo --exclude=/tmp/test/backup/file1 backup /tmp/test/backup
	Backed up 2 files, uploaded 4.0 B in 0s at 13.8 B/s average speed
	+ obnam -r /tmp/test/repo ls
	Generation 8 (2012-06-20 09:23:42 - 2012-06-20 09:23:42)
	drwxr-xr-x    24 root     root           4096 2012-06-20 05:27:42 /
	drwxrwxrwx    19 root     root            480 2012-06-20 07:23:40 /tmp
	drwxrwx---     4 jordi    jordi            80 2012-06-20 07:23:41 /tmp/test
	drwxrwx---     2 jordi    jordi            80 2012-06-20 07:23:40 /tmp/test/backup
	-rw-rw----     1 jordi    jordi             0 2012-06-20 07:23:40 /tmp/test/backup/file1
	-rw-rw----     1 jordi    jordi             4 2012-06-20 07:23:41 /tmp/test/backup/file2
	
	# when restoring, they appear, the new file2, and the old file1.
	+ rm -rf /tmp/test/backup
	+ cd /
	+ obnam -r /tmp/test/repo restore /tmp/test/backup
	--h--m--s 4 files 4 B (100 %) 1.4 KiB/s /tmp/test/backup
	+ ls -lha /tmp/test/backup
	total 4,0K
	drwxrwx--- 2 jordi jordi 80 jun 20 09:23 .
	drwxrwx--- 4 jordi jordi 80 jun 20 09:23 ..
	-rw-rw---- 1 jordi jordi  0 jun 20 09:23 file1
	-rw-rw---- 1 jordi jordi  4 jun 20 09:23 file2


---

A workaround can be found in
<http://listmaster.pepperfish.net/pipermail/obnam-flarn.net/2013-May/001929.html>.


---

This is now fixed in git master. [[done]] --liw