skeddy
January 3rd, 2005, 03:41 AM
Hi there,
I'm new to using Cron Jobs on my website, which is hosted by One and One.
I have done some research, and have come up with a backup.php script that backs up my Mysql database when ever it is run.
I have also tried to set-up a Cron Job that will run it every 12 hours (currently set for every 1 min, testing only!!), but I am getting an error message.
The Cron job is set up as follows:
MAILTO=rob@skeddy.net
*/1 * * * * /usr/local/bin/php -f /kunden/homepages/33/d85254132/htdocs/SQLBackup.php
The backup.php page runs the following:
#!/usr/local/bin/php
<?php
$file = "Databasebackup-".Date("m-d-y-H-i-s");
@exec("mysqldump -h DBHOST -u DBUSERNAME -pDBPASSWRD DB | gzip > /homepages/33/d85254132/htdocs/mysql_backup/".$file.".txt.gz");
echo "Back up job complete"
?>
The backup.php page dumps the database into a zip file, and I can run that from a browser, mobile phone, anywhere, and it does the job.
But when I use the above Cron job, I get the following message from the Cron Deamon:
X-Cron-Env: <MAILTO=rob@skeddy.net>
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/kunden/homepages/33/d85254132/htdocs>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=*********>
Message-Id: <E1ClAHl-0007AH-00@mrvnet.kundenserver.de>
X-Provags-ID: kundenserver.de abuse@kundenserver.de sender-info:85254132@infong255
No input file specified.
I can run /usr/local/bin/php /kunden/homepages/33/d85254132/htdocs/backupjob2.php directly from puTTy and it does the back up fine.
Does anyone have any thoughts ? (Apologies if the layout above is awful !!)
I'm new to using Cron Jobs on my website, which is hosted by One and One.
I have done some research, and have come up with a backup.php script that backs up my Mysql database when ever it is run.
I have also tried to set-up a Cron Job that will run it every 12 hours (currently set for every 1 min, testing only!!), but I am getting an error message.
The Cron job is set up as follows:
MAILTO=rob@skeddy.net
*/1 * * * * /usr/local/bin/php -f /kunden/homepages/33/d85254132/htdocs/SQLBackup.php
The backup.php page runs the following:
#!/usr/local/bin/php
<?php
$file = "Databasebackup-".Date("m-d-y-H-i-s");
@exec("mysqldump -h DBHOST -u DBUSERNAME -pDBPASSWRD DB | gzip > /homepages/33/d85254132/htdocs/mysql_backup/".$file.".txt.gz");
echo "Back up job complete"
?>
The backup.php page dumps the database into a zip file, and I can run that from a browser, mobile phone, anywhere, and it does the job.
But when I use the above Cron job, I get the following message from the Cron Deamon:
X-Cron-Env: <MAILTO=rob@skeddy.net>
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/kunden/homepages/33/d85254132/htdocs>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=*********>
Message-Id: <E1ClAHl-0007AH-00@mrvnet.kundenserver.de>
X-Provags-ID: kundenserver.de abuse@kundenserver.de sender-info:85254132@infong255
No input file specified.
I can run /usr/local/bin/php /kunden/homepages/33/d85254132/htdocs/backupjob2.php directly from puTTy and it does the back up fine.
Does anyone have any thoughts ? (Apologies if the layout above is awful !!)