We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8cf602a commit a6a3516Copy full SHA for a6a3516
backup.rb
@@ -16,6 +16,7 @@
16
17
backup_name = "#{now.to_s.gsub(' ', '_')}.pg_dump" # name of the created backup file
18
backup_file_path = "/tmp/#{backup_name}"
19
+backup_files = "/tmp/*.pg_dump"
20
backup_folder = "/#{db_to_backup}"
21
oldest_backup_date = (now.to_datetime << 1).to_time # More than a month old
22
@@ -40,7 +41,7 @@
40
41
client.upload "#{backup_folder}/#{backup_name}", File.read(backup_file_path)
42
43
#####################
-# Delete old backups
44
+# Delete old backups in dropbox
45
46
files = client.list_folder backup_folder
47
files.each do |file|
@@ -49,3 +50,5 @@
49
50
client.delete file.path_lower
51
end
52
53
+
54
+system("rm", backup_files)
0 commit comments