How to test a cron job?

后端 未结 2 701
故里飘歌
故里飘歌 2021-01-14 01:50

I\'m using Ubuntu Linux 10.0.4. I want to run a script every 6 hours, every day. When I issue sudo crontab -e, I see:

# m h  dom mon dow   co         


        
相关标签:
2条回答
  • 2021-01-14 02:32

    You can update the MAILTO variable to your email address, and cron should email you any STDOUT and STDERR output. Also check your syslog file /var/log/messages to see if the script is being executed by cron.

    -Tony

    0 讨论(0)
  • 2021-01-14 02:32

    Cron should mail it results so it looks like you have a problem. Here, it seems you are missing a user to run the script as :

    00,06,12,18 * * * user_name /opt/scripts/selenium/run_nis_inf_tests.sh
    

    replace user_name by the name of the user the script needs to be run by, verify permissions of "run_nis_inf_tests.sh" and you should be ok.

    0 讨论(0)
提交回复
热议问题