Jump to content

cron tabs???


sooty2006

Recommended Posts

i have recently bought a new server so i an capable ov running cron tabs when ever i need to!thing is i have read other topics related to cron jobs and i just carnt understand it!i am using linuxi can post what i have done below could someone tell me if there is something wrong!i have the correct link to it and the php file. for now the file "cron.php" only contains a script sending a mail to me so i can check if its working!

<?php$e = "admin@domain.co.uk";$email = "Hello againjust letting you know the cron server done a temp update so you know it works";$headers = "From: cron test<cron_test@domain.co.uk>\r\n";$subject = "Domain - Crontab Update";mail($e, $subject, $email, $headers);?>

cron = 15,45 * * * * /var/www/vhosts/milnas-mafia.co.uk/httpdocs/cron.phpam i missing anything?any help will be great! thanks alot!

Link to comment
Share on other sites

Well you'll need to troubleshoot that then before you try to set it up with cron. I'm sure cron is working fine, but if the script doesn't work in the first place you'll never know.Remove the \r\n from the end of the from header, it doesn't need to be there if you only have one header. Also check the junk folders in your email account, and check for an error log file on the server if displaying errors is disabled.You could also try something instead of email that you know will work, like writing to a file.

Link to comment
Share on other sites

Well you'll need to troubleshoot that then before you try to set it up with cron. I'm sure cron is working fine, but if the script doesn't work in the first place you'll never know.Remove the \r\n from the end of the from header, it doesn't need to be there if you only have one header. Also check the junk folders in your email account, and check for an error log file on the server if displaying errors is disabled.You could also try something instead of email that you know will work, like writing to a file.
i have just tryed that now using a different script
<?phprequire("includes/index.php");mysql_query("UPDATE users SET notes='cron done' WHERE id='1'");echo "done";?>

when i do the link manually it works but it still wont work only unless i do it manuallyedit:but i just recieved a mail from cronsaying/bin/sh: 15,45: command not foundthat got anything to do with it?

Link to comment
Share on other sites

I'm sure that has something to do with it. I'm not sure of the syntax for running cron, but the syntax you have looks a little wrong. You should have a program name first (like "crontab"). From this page, it looks like your entry goes in a file that crontab looks in for scheduling items, it's not a command that you run in the shell directly.http://www.adminschoice.com/docs/crontab.htm

Link to comment
Share on other sites

ok thanks i have viewed the swsoft forum they explained everything there!i had a few mistake but i understand thanks for your help! :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...