Linux teams have better tools for this. you can access linux commands using the PHP exec () function. something like that:
// db $db_backup_file = '/home/backup/db_'.date('Ym-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 > '.$db_backup_file; exec($command); // file structure $file_structure_backup_file = '/home/backup/files_'.date('Ym-d').'.tar.gz'; $command = 'tar -zcf '.$file_structure_backup_file.' /home/'; exec($command);
you need to check linux command line options and then check and configure in a safe environment. you can then ftp or email files to wherever you are. or you can put the same stuff into cron work.
source share