The script runs from command line but crontab fails

后端 未结 3 1230
情歌与酒
情歌与酒 2021-01-24 11:21

I\'m still learning Bash and I\'m having a problem with my script. I want to filter some calls with this script that is analyzing a call log, every 2 minutes as cronjob. The pro

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-24 11:58

    Looks like you may need to cd into the correct directory at the start of your script.

    Put a pwd at the beginning, followed by exit and watch the cron output to see where you're executing from. There's also a chance that you have a shorter PATH when running under cron, but it should still have access to tail and grep.

提交回复
热议问题