Hi all,
I'm trying to make an automatic backup of my database to an email. If it doesn't succeed I will go for the FTP option but I prefer using gmail for this since it's always online.
My idea is:
1. Run a Cron Job daily
2. Cron Job runs a PHP file
3. PHP file uses DirectAdmin API
4. Get http://domain.com:2222/CMD_DB/db-file.gz
5. Send to GMail.
If there's a limit on the mail server, maybe it's possible to split the file to several messages.
I know there's an API for full backup:
I don't want to use it because the first option creates a backup, lets you save the file and the deletes it. The backup API keeps the file on the server and I don't want that to happen, unless you know of a way to delete this file after usage (it's CHMOD'd 640)
I'd be happy to hear your ideas about this. My other option is to use the same method but to FTP this file instead.
The built-in scheduled backup only allows to make a full backup of all the files. This is too big for me and I need only the database.
Thanks for your replies,
Amir W.
I'm trying to make an automatic backup of my database to an email. If it doesn't succeed I will go for the FTP option but I prefer using gmail for this since it's always online.
My idea is:
1. Run a Cron Job daily
2. Cron Job runs a PHP file
3. PHP file uses DirectAdmin API
4. Get http://domain.com:2222/CMD_DB/db-file.gz
5. Send to GMail.
If there's a limit on the mail server, maybe it's possible to split the file to several messages.
I know there's an API for full backup:
PHP:
#create a backup
action=backup
I don't want to use it because the first option creates a backup, lets you save the file and the deletes it. The backup API keeps the file on the server and I don't want that to happen, unless you know of a way to delete this file after usage (it's CHMOD'd 640)
I'd be happy to hear your ideas about this. My other option is to use the same method but to FTP this file instead.
The built-in scheduled backup only allows to make a full backup of all the files. This is too big for me and I need only the database.
Thanks for your replies,
Amir W.
Last edited: