I require a PHP script which can be initiated via cPanel cron job.
The script must generate a full cPanel backup, wait for the backup to complete and then automatically upload it to my Dropbox account. Once the upload is done, the script should send me an email with the log (date, account name, file name and file size) and save it to a database and any errors that can exists.
- I don't want to have to do anything manual, the file the cron runs should do everything.
- It should not delete previous backups.
- I need to be able to specify the Dropbox folder which it uploads the backup to.
- I need to be able to use the script on multiple websites/cPanel accounts, so it can't be locked to a domain.
- It would be nice if the email notification displayed the backup file name and file size in the body. Also in the subject; the timestamp.
- The web servers are Linux-based cPanel.
This process needds to be completely automatic. The process will be as follows, with no intervention by myself:
1. A cron which I setup runs a file.
2. The file initiates a full cPanel backup.
3. The file waits for the backup to complete, I assume via the cPanel API?
4. The backup is stored locally.
5. When complete, the backup is uploaded to my Dropbox account in a specified folder.
6. When the backup is uploaded to Dropbox, the local (on the server) copy is deleted.
Please let me know if you need any further information.