1

I am running Ubuntu 12.04 LTS Desktop.

I have used the /etc/crontab to set up a couple of entries that should run at different schedules.

Now, the problem is that these do not seem to be running. I have used these same entries in other ubuntu systems and they work alright.

Here is my crontab file:

#--------------------------------------------------------------------------------
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user  command
17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
​6  2-6/2 * * *  root    wget localhost/estimator/update_to_cs.php
​26 2-6/2 * * *  root    wget localhost/estimator/update_estimator_cron.php
*  *     * * *  printo  touch /home/printo/test_cron_output.txt
*  *     * * *  printo  date >> /home/printo/test_cron_output.txt
#--------------------------------------------------------------------------------

The user printo exists and has sudo privileges as well.

ps -ef | grep cron shows that cron is running.

Any pointers on what I may be missing or a way to get to the root of the issue?

TIA.

2
  • 1
    "wget localhost/estimator/update_to_cs.php" are you sure this is correct? The filename to the .php seems wrong to me. Plus wget will output and you do no redirect it.
    – Rinzwind
    Jan 27, 2014 at 14:30
  • Yes it's correct. That php page exists on this very machine, which is setup as a webserver.
    – im-not-you
    Jan 28, 2014 at 8:00

1 Answer 1

1

I managed to find the issue and resolve it. I looked in /var/log/syslog to find cron complaining about formatting errors / invalid characters.

cat -v /etc/crontab

showed there were some non-printing characters in the file which I then removed, and it works just fine.

Thanks for your help @Rinzwind.

You must log in to answer this question.

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