Running a simple shell script as a cronjob

后端 未结 5 1783
伪装坚强ぢ
伪装坚强ぢ 2020-12-16 11:57

I have a very simple shell script I need to run as a cronjob but I can\'t get even the test scripts to run. Here\'s and example script:

/home/myUser/scripts/test.sh<

5条回答
  •  难免孤独
    2020-12-16 12:16

    Specify complete path and grant proper permission to scriptfile. I tried following script file to run through cron:

    #!/bin/bash
    /bin/mkdir /scratch/ofsaaweb/CHEF_FICHOME/ficdb/bin/crondir
    

    And crontab command is

    * * * * * /bin/bash /scratch/ofsaaweb/CHEF_FICHOME/ficdb/bin/test.sh
    

    It worked for me.

提交回复
热议问题