-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample.rb
41 lines (31 loc) · 872 Bytes
/
sample.rb
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
# name of the sync
# if it is an existing path then `source` is set this value
sync '4tb' do
enabled = false
# watchers available:
# - :rb (default)
# - :py_inotify
# - :cmd (inotifywait)
# - :py_watchdog
#
watcher = :rb
# fork to user below, usually associated with private keys
user = :root
# interval to collect all watched events and run rsync
delay = 5
# event list from inotify
# full list at https://man.archlinux.org/man/inotifywait.1#EVENTS
modes = %i[create modify delete]
source = '/mnt/4tb/'
target rsync: 'user@remote:/mnt/4tb' do
opts = '-ax --partial' # default
# enables bidirectional sync, using rsync's --update and a pyinotify based watcher
reverse_sync
end
# possible values are: true, false, :initial, :watched
delete = true
excludes = [
'.snapshots',
]
log.info 'starting'
end