Optional user-defined identifier to differentiate multiple syncers defined
within a single backup model. Currently this is only used in the log
messages.
Public Class Methods
new(syncer_id = nil)click to toggle source
# File lib/backup/syncer/base.rb, line 24definitialize(syncer_id = nil)
@syncer_id = syncer_idload_defaults!@mirror||=false@directories = []
@excludes = []
end
Public Instance Methods
add(path)click to toggle source
# File lib/backup/syncer/base.rb, line 41defadd(path)
directories<<pathend
directories(&block)click to toggle source
Syntactical suger for the DSL for adding directories
# File lib/backup/syncer/base.rb, line 36defdirectories(&block)
return@directoriesunlessblock_given?instance_eval(&block)
end
exclude(pattern)click to toggle source
For Cloud Syncers, pattern can be a
string (with shell-style wildcards) or a regex. For RSync, each pattern will be passed to
rsync’s –exclude option.
# File lib/backup/syncer/base.rb, line 48defexclude(pattern)
excludes<<patternend