lib/dreamback/backup.rb in dreamback-0.0.8 vs lib/dreamback/backup.rb in dreamback-0.0.9
- old
+ new
@@ -35,9 +35,11 @@
sftp.dir.foreach(BACKUP_FOLDER) do |entry|
# Names should be like "dreamback.20120520", so we can sort on the folder name
backup_folders << [ entry.name, entry.name.split(".")[1].to_i ] if entry.name.include?("dreamback")
backup_folders.sort! {|a,b| b <=> a}
end
+ else
+ sftp.mkdir(BACKUP_FOLDER)
end
# Don't rotate if there aren't any previous folders
unless backup_folders.empty?
# Get yesterday's folder to link against
\ No newline at end of file