-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest3.sh
More file actions
executable file
·39 lines (31 loc) · 836 Bytes
/
test3.sh
File metadata and controls
executable file
·39 lines (31 loc) · 836 Bytes
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
#!/bin/busybox ash
rm -rf test
mkdir -p test/src/ignore test/src/use/me
export BACKUP_ROOT="$PWD/test"
export BACKUP_TIME_FORMAT="%F %T"
export BACKUP_CONFIG="/dev/null"
./init.sh
which tree >/dev/null 2>&1 || tree() { `which find` $2 -printf '%i\t%p\n'; }
# test 1: sync whole tree
echo a>test/src/ignore/file
echo b>test/src/use/me/file
echo c>test/src/use/file
rsync -a "$PWD/test/src/" "$PWD/test/current"
./backup.sh
tree --inodes test
sqlite3 -column -header test/backup.db 'select * from history;'
echo "looks good?"
read
# test 2: sync only one subdir
echo d>test/src/ignore/file
echo e>test/src/use/me/file
echo f>test/src/use/file
run_this()
{
run_rsync always use/me "$PWD/test/src/use/me/"
}
. ./backup.sh
tree --inodes test
sqlite3 -column -header test/backup.db 'select * from history;'
echo "looks good?"
# read