News
Scheduled Backup on Shared Hosting
Please note that this method relies on cronjobs which only work on Linux.To backup website contents on a weekly basis, a cron job can be setup to tar up the contents into a downloadable file.
To setup this cron job, navigate to :
Websites > domainname > More Tools > Cron Management
For your website files:
/bin/tar -czf /usr/local/pem/vhosts/$Webspace_ID/webspace/httpdocs/backup.tar.gz /usr/local/pem/vhosts/$Webspace_ID/webspace/httpdocs/$Folder_to_Backup
Replace the $Webspace_ID with your webspace ID.
You can retrieve your webspace ID by selecting the appropriate subscription from the subscription dropdown menu near the top right then select the ‘websites’ tab. The ‘webspace ID’ will be in the Web Hosting column.
A dated backup of your files:
If you want a dated backup, Create a txt file and add the following to it:
/bin/tar -czf /usr/local/pem/vhosts/$Webspace_ID/webspace/httpdocs/backup-`date +%d.%m.%y`.tar.gz /usr/local/pem/vhosts/$Webspace_ID/webspace/httpdocs/$Folder_to_Backup
Save this file to a location on the webspace and in the cron management, enter
/bin/sh /usr/local/pem/vhosts/$Webspace_ID/webspace/httpdocs/Script_name
This will create a the tar file with the current date of the backup.
Replace the Folder_to_Backup with the folder within httpdocs with the folder your website content reside in.
For your database:
/usr/bin/mysqldump -h $database_hostname -u $database_username -p$password $database_name >/usr/local/pem/vhosts/$Webspace_ID/webspace/httpdocs/database_backup.sql
Replace $database_hostname, $database_username, $password, $database_name and $Webspace_ID with the relevant details. Note the lack of space between -p and the password.
NOTE: If you are running the cron on an application vault install database and do not know the database password. You will need to create a new database user and use its credentials in the cron job (see FAQ above)
These cronjobs can be set to run weekly and should create a file in your httpdocs folder, this can then be downloaded as a single file.
Under the following you will need to update the domain to point to your current hosting package:
Domain Overview > Domain Administrator > domainname.tld > DNS > Change DNS