Crontab - simple echo not running

后端 未结 2 1845
迷失自我
迷失自我 2021-02-12 05:00

I\'ve got such situation: I want to schedule a job with crontab on a linux server. I\'m not super-user, so I\'m editing (with crontab -l, editor vim) only my crontab file. For t

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-12 05:29

    May be it is, cron jobs will run in their own shell. So you can't expect to see asdf on your console.

    What you should try is

    * * * * * echo asdf > somefile_in_your_home_directory_with_complete_path.log
    

    Next check the file by doing a tail:

    tail -f somefile_in_your_home_directory_with_complete_path.log
    

    And if it's not, check if the cron daemon itself is running or is down:

    # pgrep crond
    

    OR

    # service crond status
    

提交回复
热议问题