crontab

cronjob does not execute a script that works fine standalone

扶醉桌前 提交于 2019-11-26 03:29:05
问题 I have my php script file in /var/www/html/dbsync/index.php . When cd /var/www/html/dbsync/ and run php index.php it works perfectly. I want to call PHP file through sh file, the location of SH file is as below /var/www/html/dbsync/dbsync.sh This is the content of the dbsync.sh file is: /usr/bin/php /var/www/html/dbsync/index.php >> /var/www/html/dbsync/myscript.log 2>&1 -q -f When I cd /var/www/html/dbsync/ and run ./dbsync.sh it works perfectly as well. Now if I set up crontab as below: 1 *

How to specify in crontab by what user to run script?

你离开我真会死。 提交于 2019-11-26 02:41:52
问题 I have few crontab jobs that run under root, but that gives me some problems. For example all folders created in process of that cron job are under user root and group root. How can i make it to run under user www-data and group www-data so when i run scripts from my website i can manipulate those folders and files? My server runs on Ubuntu. Current crontab job is: */1 * * * * php5 /var/www/web/includes/crontab/queue_process.php >> /var/www/web/includes/crontab/queue.log 2>&1 回答1: Instead of

AWS Elastic Beanstalk, running a cronjob

倾然丶 夕夏残阳落幕 提交于 2019-11-26 02:27:43
问题 I would like to know if there is a way to setup a cronjob/task to execute every minute. Currently any of my instances should be able to run this task. This is what I have tried to do in the config files without success: container_commands: 01cronjobs: command: echo \"*/1 * * * * root php /etc/httpd/myscript.php\" I\'m not really sure if this is the correct way to do it Any ideas? 回答1: This is how I added a cron job to Elastic Beanstalk: Create a folder at the root of your application called

CronJob not running

我怕爱的太早我们不能终老 提交于 2019-11-26 01:24:52
问题 I have setup cronjob for root user in ubuntu environment as follows by typing crontab -e 34 11 * * * sh /srv/www/live/CronJobs/daily.sh 0 08 * * 2 sh /srv/www/live/CronJobs/weekly.sh 0 08 1 * * sh /srv/www/live/CronJobs/monthly.sh But the cronjon do not run. I have tried checking if the cronjob is running using pgrep cron and that gives process id 3033.The shell scrip is calls python file and is used to send email. Running the python file is ok. There\'s no error in it but the cron doesn\'t

Using crontab to execute script every minute and another every 24 hours [closed]

喜你入骨 提交于 2019-11-26 00:39:28
问题 I need a crontab syntax which should execute a specific PHP script /var/www/html/a.php every minute. The execution on every minute must start at 00:00. The other task which must execute a script at 00:00 /var/www/html/reset.php (once every 24 hours). 回答1: every minute: * * * * * /path/to/php /var/www/html/a.php every 24hours (every midnight): 0 0 * * * /path/to/php /var/www/html/reset.php See this reference for how crontab works: http://adminschoice.com/crontab-quick-reference, and this handy

Use PHP to create, edit and delete crontab jobs?

被刻印的时光 ゝ 提交于 2019-11-25 23:09:32
问题 Is it possible to use PHP to create, edit and delete crontab jobs? I know how to list the current crontab jobs of the Apache user: $output = shell_exec(\'crontab -l\'); echo $output; But how to add a cron job with PHP? \'crontab -e\' would just open a text editor and you will have to manually edit the entries before saving the file. And how to delete a cron job with PHP? Again you have to manually do this by \'crontab -e\'. With a job string like this: $job = \'0 */2 * * * /usr/bin/php5 /home

crontab 定时器使用

独自空忆成欢 提交于 2019-11-25 19:30:04
crontab 定时器使用 crontab 使用方法 crontab 使用方法很简单,但是不注意细节也是不行滴。在这里记录一下。 1.首先: pip3 install django_crontab 2.setting中配置: INSTALLED_APPS = [ ‘django_crontab’, #定时器工具库 ‘TmallBusinessData’,#app名称 ] CRONJOBS = [ (’*/1 * * * *’, ‘TmallBusinessData.views.testTasks’), 每一秒执行一次 (‘2 * * * *’, ‘TmallBusinessData.views.pasringHotRank’), 每小时的第二分钟执行一次 (‘20,40 * * * *’, ‘TmallBusinessData.views.muli_data’), 每小时的第20分钟,第40分钟分别执行一次 ] 注意:TmallBusinessData.views.testTasks 项目名.类名.方法名 我试过把定时任务写在其他的方法里,但是都没有成功。只有写在views里百世百中。。有知道为什么的请评论区留言 来源: https://blog.csdn.net/qingsi00/article/details/98727631