Muối Nhạt's site

Make notes and share experiences

Make notes and share experiences

Full Backup for Shared Hosting using Directadmin

  1. Make cronjob on directadmin panel to perform daily backup
  2. Make cronjob on a remote linux computer to download the backup

Directadmin has provided a several scripts on this page: http://files.directadmin.com/services/all/

1. Make cronjob on directadmin panel to perform daily backup

Now, you can download the file called: link

  • Make a copy of downloaded file
  • Fill-in your shared hosting account into backup.php script
  • Follow the instruction in the script, that it shall be like

1) Place this file somewhere under your home directory.
A good place might be:

/home/username/backup.php

From the File Manager in DA, that would be: /backup.php

2) Chmod the file to 700. This is very important for security.

3) Edit the above variables.
Most likely, you”ll only need to change the username and password.
If your system uses ssl to connect to DA (https) then you’ll need to set $ssl = 1;

4) Create the cronjob to execute:

/home/username/backup.php

as often as you wish. Usually once per day is the most you’ll want to run it.
To create the cronjob, see: http://www.site-helper.com/misc.html#cron

Usually a very early morning hour, say 5am is best as the load is usually lowest then.

Note that we do not need to add /usr/local/bin/php in front of this php script because of the
#!/usr/local/bin/php -n
line at the very top.

5) check your ‘username’ account. Any emails will be delivered there if it doesn’t work.
If needed, you can test manually via ssh by running:

/home/username/backup.php

2. Make cronjob on a remote linux computer to download the backup

RELATED POSTS

[Kubernetes] – Check your Helm deployments!

Here’s a very popular post about safely deploying Helm charts containing Kubernetes Deployments with automated rollbacks. Originally published in 2019, it’s still relevant today – if you encounter something that should be updated, please let us know! — The Deployment resource

Read More »
Share the Post: