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