backup revision 5efadb4662f2a63d5f5f1a5b303ab7c3371069a8
1057N/A # Amount of backups that have to be there at least 1057N/A # Backups are valid for 7 days 1589N/A # We needed to create the directory for the script to continue later on. 1741N/A puts "created backup in #{backup_instance_dir}" 1703N/A puts "restored backup from #{backup_instance_dir}" 684N/A puts "Nothing to prune: There is no backup directory." 684N/A # Create directory even in dry run to let the script continue. 684N/A exec "pg_dump -U postgres -Fc #{db_name} > #{SQL_DUMP_FILE}" 1703N/A exec "sudo -u postgres pg_dump -Fc #{db_name} > #{SQL_DUMP_FILE}" 1703N/A puts "Error: Backup '#{backup_name}' does not exist in #{backup_root}." 1703N/A exec "pg_restore -c -U postgres -d #{db_name} #{SQL_DUMP_FILE}" 1703N/A exec "sudo -u postgres pg_restore -c -d #{db_name} #{SQL_DUMP_FILE}" 1703N/A puts 'To restore a backup, you need to specify one with the arguments' 1741N/A puts 'use parameter "create" or "restore <backup_name>" or "prune"'