DirectAdmin backup to CloudVPS Objectstore with CURL v2

By | January 1, 2017

We use the CloudVPS Objectstore to store data in a redundant (3 times) and cheap way, ideal for backups. One of the main disadvantages is that files on the Objectstore may not be larger than 5 GB in size. To workaround this we created a customized ftp_upload.php script (= bash script that handles the upload of backup files within DirectAdmin) that split files larger than 5 GB into smaller files of 4 GB each, which has the disadvantages that you cannot restore these backups through the DirectAdmin GUI any more. 99% of the DirectAdmin accounts are never larger than 5 GB so this is not a big issue.

DirectAdmin only supports FTP or SFTP to connect to your backup destination. CloudVPS has a FTP to Objectstore proxy so you can upload your backups through FTP to the Objectstore, great!. Since FTP data is not encrypted (SFTP is) and because the FTP to Objectstore has some issues from time to time we developed a new customized ftp_upload.php that uses CURL to upload the backup files to the Objectstore.

Version 2 of this script fixes the following issues:
– The ftp_upload.php file is now compatible with non-Objectstore destinations in case you want to create (occasional) backups to another FTP site.
– cURL is forced to use TLS 1.2 for encryption.

DirectAdmin backup settings:
IP: ftp.objectstore.eu
Username: <projectid>:<username>
Password: <your password>
Remote Path: <name of the folder in your destination>
Port: 21 (only used when using stock ftp_upload.php)
Secure FTP: <choose> (only used when using stock ftp_upload.php)

In case you cannot add a new backup schedule because of FTP timeouts please read article: https://www.sysblog.nl/cloudvps-objectstore-ftp-proxy-firewall-rules-csf/

The file can be saved to:
/usr/local/directadmin/scripts/custom/ftp_upload.php

The script:

*warning* We are not responsible for any kind of damage or incompatibilities you experience when using this article, test this on a test server first before using it in production. Always check the code of the patch file yourselves before implementing it. */warning*.

Leave a Reply

Your email address will not be published. Required fields are marked *