0

I've installed the following CRON job using 'crontab -e' through putty on my server, but it won't run and I have no idea why.

This is the line I'm putting in and saving using 'crontab -e':

00 09-18 * * 1-5 /usr/bin/php5 /home/a/v/ava/public_html/p/app_availability_updates_flush.php

It's a simple script I want to run on the hour during business hours.

When I use 'crontab -l' it prints the following:

00 09-18 * * 1-5 /usr/bin/php5 /home/a/v/ava/public_html/p/app_availability_updates_flush.phproot@ds6639:~#

Does that look right?

2 Answers 2

6

Add a newline after your cron line. In other words, use crontab -e and press enter at the end of your current line.

1
  • 3
    Yep. A tip for you to similar issues in the future (for other software than cron, too): if output of some command gets messed up like in your original output (the shell prompt gets appended right after your previous command, instead of prompt getting a new clean line), you might need to add a newline after whatever you did. :) Way too many pieces of software parse their configuration files by splitting them with newlines, and if there's not a newline character after the last line ... well... that won't get parsed. Another typical gotcha: DOS/Windows newlines: \r\n is not loved in Unix world. Mar 27, 2012 at 11:32
0

To find out what isn't working check the mail for the account that is running the job as all output from the job gets mailed to it.

You can also capture the output yourself to a file which may be easier

00 09-18 * * 1-5 /usr/bin/php5 /home/a/v/ava/public_html/p/app_availability_updates_flush.php &>/tmp/cronjob.log
1
  • Thanks for your help Lain but Janne got it!
    – bbeckford
    Mar 27, 2012 at 11:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .