Search code examples
linuxcroncron-task

Active cron job


I am trying to make a cron job for the first time but i have some problems making it work.

Here is what i have done so far:

Linux commands:

crontab -e

My cronjob looks like this:

1 * * * * wget -qO /dev/null http://mySite/myController/myView

Now when i look in:

/var/spool/cron/crontabs/

I get the following output:

marc root

if i open the file root

i see my cronjob (the one above)

However it doesnt seem like it is running.

is there a way i can check if its running or make sure that it is running?


Solution

  • By default cron jobs do have a log file. It should be in /var/log/syslog (depends on your system). Vouch for it and you're done. Else you can simply append the output to a log file manually by

    1 * * * * wget http://mySite/myController/myView >> ~/my_log_file.txt
    

    and see what's your output. Notice I've changed removed the quiet parameter from wget command so that there is some output.