crontabs |
This is a discussion on crontabs within the Server Management forums, part of the Website Management category; Looks like I'm hogging this forum section, but I have another question!! I'm trying to set up a cron job ... |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 |
| Member |
Looks like I'm hogging this forum section, but I have another question!! I'm trying to set up a cron job to run every 5 minutes. The server this is running on has no GUI (which is what I'm used to!) so for the first time I'm doing this through SSH. I was wondering if this is the correct syntax to use in the file after running 'crontab -e'. Well... it's not working, so I assume it's wrong... I guess I'm more asking why it's wrong! lol: Code: */5 * * * * /path/to/file/foo.php Thanks! Stu |
| | |
| | #2 |
![]() Join Date: Jan 2009
Posts: 783
Blog Entries: 16 Thanks: 17
Thanked 35 Times in 35 Posts
![]() ![]() Expertise: Design & Graphics Experience: Quite Good |
have you ran: /path/to/file/foo.php from the ssh terminal? it will probably not give any output as you are not telling it to do anything. you need to run the file through php, so it should be: php /path/to/file/foo.php |
| | |
| The Following User Says Thank You to Tom For This Useful Post: | stu2000 (13th July 2010) |
| | #3 |
| Member |
Thank you! ... long day, I know you have to run it as a php file... so why didn't I? lol Because I'm an idiot that's why... hmmm Right, the problem now is I think I don't have the right path. Which I'll have to get onto these hosts about. Also, I can only run it if I'm in the same directory the as the actual script. e.g. if the script 'bar.php' in: /htdocs/foo/ and I'm in 'htdocs', I can't run: Code: php /foo/bar.php Code: cd /htdocs/foo I'm starting to question my intelligence now lol! |
| | |
| | #4 |
| Member |
Cancel that, it is working! Thanks a lot mate, sometimes it's the most obvious thing you miss... ...well I talk for myself there, it's always the most obvious thing with me lol! Last edited by stu2000; 13th July 2010 at 04:37 PM.. |
| | |
| | #5 |
![]() Join Date: Jan 2009
Posts: 783
Blog Entries: 16 Thanks: 17
Thanked 35 Times in 35 Posts
![]() ![]() Expertise: Design & Graphics Experience: Quite Good |
what was the issue with the directories? I spent 20 minutes looking at a domain the other day because DNS wasnt working for it, didnt think to check what name servers it was on and wasted my time looking at the wrong things... it was just one of those days :D |
| | |
| | #6 |
| Member |
yeah, tell me about it! ta for the help tho, directory problem wasn't a problem, I was just finishing my day having another "moment" lol
|
| | |
![]() |
| Tags |
| crontabs, ssh |
| Thread Tools | |
| Display Modes | |