execute instead of echo restore commands

This commit is contained in:
Matthew Saunders Brown 2022-07-16 15:25:51 -07:00
parent 1e5ad4ba71
commit 0a72e082c3
3 changed files with 7 additions and 9 deletions

View File

@ -124,9 +124,9 @@ if [[ $verify_back_dir == FALSE ]]; then
fi
# perform restore
# Still in testing mode, display command instead of running it
echo "To restore $pathtorestore from $backup run this command:"
echo "/usr/bin/rsync -vn --archive --numeric-ids --one-file-system --delete $pathtobackup $pathtorestore"
echo "Running:"
echo "/usr/bin/rsync -v --archive --numeric-ids --one-file-system --delete $pathtobackup $pathtorestore"
/usr/bin/rsync -v --archive --numeric-ids --one-file-system --delete $pathtobackup $pathtorestore
bashup::unmount_storage_dir

View File

@ -100,10 +100,9 @@ fi
# check that dump exists and restore it now
if [ -d $backup_storage_dir/$backup ]; then
if [ -f $backup_storage_dir/$backup/mysql/$dump ]; then
# Still in testing mode, display command instead of running it
echo "To restore database $database from backup $backup run this command:"
echo "running:"
echo "/usr/bin/zcat $backup_storage_dir/$backup/mysql/$dump | mysql --defaults-extra-file=$defaults_extra_file $database"
# echo "SUCCESS: Database $database from backup $backup has been restored."
/usr/bin/zcat $backup_storage_dir/$backup/mysql/$dump | mysql --defaults-extra-file=$defaults_extra_file $database
else
echo "ERROR: Dump for database $database does not exist in the $backup backup dir."
exit 1

View File

@ -100,10 +100,9 @@ fi
# check that dump exists and restore it now
if [ -d $backup_storage_dir/$backup ]; then
if [ -f $backup_storage_dir/$backup/pdns/$zone_file ]; then
# Still in testing mode, display command instead of running it
echo "To restore zone $zone from backup $backup run this command:"
echo "running:"
echo "/usr/bin/pdnsutil load-zone $zone $backup_storage_dir/$backup/pdns/$zone_file"
# echo "SUCCESS: Zone $zone from backup $backup has been restored."
/usr/bin/pdnsutil load-zone $zone $backup_storage_dir/$backup/pdns/$zone_file
else
echo "ERROR: Zone file for zone $zone does not exist in the $backup backup dir."
exit 1