Permission denied with bash.sh to run cron

前端 未结 5 512
忘掉有多难
忘掉有多难 2020-11-29 12:19

How to run a cron with bash script here.What i did as follows and here with errors.I want to know how to do that in ubuntu.I was struck with it now

bash.sh file

5条回答
  •  春和景丽
    2020-11-29 12:46

    you can try the following solution as well:

    chmod +x post.php
    chmod +x bash.sh
    echo "* * * * * /home/samitha/bash.sh >> /home/samitha/log/cron.log 2>&1" >> cronjob
    
    chmod +x cronjob
    
    /etc/init.d/crond start  #redhat based servers like centos
    /etc/init.d/cron  start  #debian based servers like ubuntu
    
    crontab cronjob
    

提交回复
热议问题