Bubbs
11-08-2006, 10:18 AM
I created a Cron Job to backup a Points Databas for a Gaming Clan.
Here is the scripts... I changed the server / PW infor to proteect the innocent :)
<?php
set_time_limit(600);
mysql_backup('database', 'user', 'PW');
function mysql_backup($dbname, $dbuser, $dbpass)
{
$old_umask = umask(0);
shell_exec('mysqldump --user=' . $dbuser . ' --password=' . $dbpass . ' --add-drop-table --complete-insert ' . $dbname . ' | gzip > backup/' . $dbname . '/' . date('mdy_H') . '-' . $dbname . '.sql.gz');
umask($old_umask);
}
?>
Here is the error I receive via Email when it runs the cron job at night:
/bin/sh: http://www.yoursitename.com/eqdkp/eqdkpbackup.php: No such file or directory
For some reason it is adding a ":" after the file name and I can;t seem to figure out why.
any ideas?
Here is the scripts... I changed the server / PW infor to proteect the innocent :)
<?php
set_time_limit(600);
mysql_backup('database', 'user', 'PW');
function mysql_backup($dbname, $dbuser, $dbpass)
{
$old_umask = umask(0);
shell_exec('mysqldump --user=' . $dbuser . ' --password=' . $dbpass . ' --add-drop-table --complete-insert ' . $dbname . ' | gzip > backup/' . $dbname . '/' . date('mdy_H') . '-' . $dbname . '.sql.gz');
umask($old_umask);
}
?>
Here is the error I receive via Email when it runs the cron job at night:
/bin/sh: http://www.yoursitename.com/eqdkp/eqdkpbackup.php: No such file or directory
For some reason it is adding a ":" after the file name and I can;t seem to figure out why.
any ideas?