You shouldn't need to switch to bash before running it, but when you do execute it, it will run inside a bash shell. The syntax between csh and bash scripts are slightly different.
In order to restore your site from a backup taken with this, you would follow these steps from shell:
Code: Select all
# restore mysql backup. this will prompt for DB password
# after entering password, it will drop all wordpress tables and restore them from the backup
mysql -u DB_USER -p DB_NAME < ~/wordpress_backups/wordpress-date.sql
# restore the file backup
tar -v -z -C / -xf ~/wordpress_backups/wordpress-date.tar.gz
The backup was taken leaving the path preceding all the files, so the "-C /" option extracts the archive to the root of the server so the paths resolve back into /home/u/username/public_html/domain.tld. If you were restoring due to a website compromise, another option would be to extract the tar to a temporary location, and then use rsync to restore the files and delete extraneous files (those that were not in the backup) after it restores.
So it's a pretty simple two step process.
1. Restore the MySQL database with mysql
2. Extract the files from backup and overwrite or restore the site to the hosting directory