-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdo_backup.yaml
87 lines (78 loc) · 2.35 KB
/
do_backup.yaml
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
---
# do_backup.yaml
# Top level variables will be overridden by identically named variables
# within the hosts definitions.
logs:
level: info # Could be 'debug', 'info', 'warning', 'error', or 'critical'.
# Each file backup is logged at the 'info' level.
dir: bk_logs # Relative or absolute; files within are named "{host}/{timestamp}.log".
# Logs age out with the corresponding backups.
# target_dir can be an absolute path, or relative to the script's directory.
target_dir: backups
max_backups: 17 # older backups get removed
max_partials: 5 # incrementals between full backups
max_tail: 4 # controls how older backups are removed.
# excludes: a list of rsync "--exclude=" parameters to apply to every backup
# (unless overridden by an "excludes" list in the relevant "hosts" definition).
excludes:
- /**/.cache/
- /**/.ccache/
- /**/cache/
- /**/Cache/
- /dev/
- /proc/
- /run/
- /sys/
# Some flags to rsync:
# -a short for -r -l -p -t -g -o -D
# -r --recursive
# -l --links
# -p --perms
# -t --times
# -g --group
# -o --owner
# -D --devices and --specials
# -H --hardlinks
# -A --acls
# -X --xattrs
# -x --one-file-system
# --del --delete-during; receiver deletes extraneous files from destination dirs
# Choose rsync flags depending on src and dst filesystem types.
# The first entry that matches both src and dst will be used; subsequent
# entries will be ignored.
rsync_opt_map:
- src_fs_type: ['ext2', 'ext3', 'ext4']
dst_fs_type: ['ext4']
options: ['-a', '-H', '-A', '-X', '-x', '-v' ]
- src_fs_type: [ 'fat32', 'ntfs', 'unknown', 'ext2', 'ext3', 'ext4' ]
dst_fs_type: ['ext4', 'tmpfs']
options: ['-a', '-H', '-A', '-x', '-v' ]
uid: root
hosts:
tarna:
excludes:
- /dev/
- /proc/
- /run/
- /sys/
- /**/ImapMail/
- /smb/todd/trailsong.img.*
- /smb/todd/trailsong.tgz
data:
- src: /home
dst: home
- src: /root
dst: root
- src: /etc
dst: etc
- src: /backups
dst: backups
- src: /var/spool/imap
dst: var_spool_imap
- src: /var/lib/imap
dst: var_lib_imap
lappy:
uid: utoddl
data:
- src: /home/utoddl/src/neg
dst: neg