Does anybody know a clean PHP-based solution that can backup remote web sites using FTP?
Must haves:
Would be nice:
I need this to be PHP based because it's going to be used on shared hosting packages that do not allow usage of the standard GNU/Linux tools.
I have done something like this in a cron job PHP script before. Not sure if it is the best way, but it certainly works.
$backup_file = '/home/example/sql_backup/mo_'.date('Y-m-d').'.sql.gz';
$command = '/usr/bin/mysqldump -c -h'.DB_HOST.' -u'.DB_USER.' -p'.DB_PASS.' --default-character-set=latin1 -N '.DB_NAME.' | gzip > '.$backup_file;
exec($command);
You could then exec an sftp to the remote server.
You could do the file folders similarly using exec() and linux zipping.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With