-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate.sh
55 lines (40 loc) · 830 Bytes
/
generate.sh
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
#
# Functions for pov-simple-backup
#
pending=""
emit() {
if [ -n "$pending" ]; then
printf "%s" "$pending"
pending=""
fi
printf '%s\n' "$*"
}
prefix() {
pending="$*"
}
separator() {
prefix "
"
}
generate() {
emit "#
# pov-simple-backup configuration for $(hostname -f)
#
# Generated by pov-simple-backup on $(date +"%Y-%m-%d %H:%M:%S")
#"
separator
emit "back_up /etc
back_up /root
back_up /usr/local
back_up /var/cache/debconf/config.dat
back_up_dpkg_selections"
separator
test -x /usr/bin/psql && emit "back_up_postgresql"
test -x /usr/bin/mysql && emit "back_up_mysql"
separator
emit "generate_checksums"
separator
emit "clean_up_old_backups 14"
separator
emit "##copy_backup_to backups@backups.pov.lt:/backups/$(hostname)/"
}