bash.sh 拒绝运行 cron 的权限
如何在这里使用 bash 脚本运行 cron.我做了如下操作,这里有错误.我想知道如何在 ubuntu 中做到这一点.我现在对它感到震惊
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 文件
#!/bin/bash
cd /var/www/Controller
/usr/bin/php post.php
在 crontab -e 中
In crontab -e
* * * * * /home/samitha/bash.sh >> /home/samitha/log/cron.log 2>&1
但现在我收到以下错误
/bin/sh: 1: /home/samitha/bash.sh: Permission denied
我将如何修复它?我做错了什么?
How will i fix it ? what i did wrong ?
推荐答案
您也可以尝试以下解决方案:
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
相关文章