class AwsRotate::Backup
Public Instance Methods
credentials_exist?()
click to toggle source
# File lib/aws_rotate/backup.rb, line 11 def credentials_exist? File.exist?(@credentials_path) end
run()
click to toggle source
# File lib/aws_rotate/backup.rb, line 3 def run return if @options[:noop] || @options[:backup] == false return unless credentials_exist? backup_path = @credentials_path + ".bak-#{Time.now.strftime("%F-%T")}" FileUtils.cp(@credentials_path, backup_path) puts "Backed up credentials file at: #{backup_path}" end