Module: Puppet::Util::Backups

Defined in:
lib/puppet/util/backups.rb

Instance Method Summary collapse

Instance Method Details

#perform_backup(file = nil) ⇒ Object

Deal with backups.


6
7
8
9
10
11
12
13
14
15
16
# File 'lib/puppet/util/backups.rb', line 6

def perform_backup(file = nil)
  # if they specifically don't want a backup, then just say
  # we're good
  return true unless self[:backup]

  # let the path be specified
  file ||= self[:path]
  return true unless Puppet::FileSystem.exist?(file)

  return(self.bucket ? perform_backup_with_bucket(file) : perform_backup_with_backuplocal(file, self[:backup]))
end