cron-task

crontab issue when using exec php script?

半腔热情 提交于 2019-12-06 12:02:57
问题 I am using elementaryOS (base on ubuntu) When I run commaand line: kn3l@kn3l:/var/www/cronjob$ 25 15 * * * /var/www/cronjob/helloworld.php > /var/www/cronjob/cron.log and it works for crontab with terminal command line. BUT When I using PHP with my code like this (test.php): -rwxrwxrwx 1 kn3l kn3l 47 Jun 6 14:59 test.php* test.php <?php $output = shell_exec('crontab -l'); echo "<pre>$output</pre>"; I go to http://localhost/test.php Why I did not see any return like the command line? Anyone

Google Cloud Function - AttributeError: 'module' object has no attribute 'DEFAULT_MAX_REDIRECTS'

血红的双手。 提交于 2019-12-05 19:42:06
I'm using Appengine cron job to schedule cloud function and when I deploy and try to run a job, getting below error. Any idea what could be wrong here? Followed steps from [here][1] (/base/alloc/tmpfs/dynamic_runtimes/python27/a7637d5531ec9deb_unzipped/python27_lib/versions/1/google/appengine/runtime/wsgi.py:263) Traceback (most recent call last): File "/base/alloc/tmpfs/dynamic_runtimes/python27/a7637d5531ec9deb_unzipped/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 240, in Handle handler = _config_handle.add_wsgi_middleware(self._LoadHandler()) File "/base/alloc/tmpfs

wordpress schedule event not firing in set time

独自空忆成欢 提交于 2019-12-05 11:45:57
In WordPress I am creating a plugin where I am sending email to users. For that I am using WordPress cron job. So basically what it will do is just send emails to users in every hour. So my code looks like this public function __construct() { add_action('init', array( $this, 'send_emails_to_users') ); add_action('cliv_recurring_cron_job', array( $this, 'send_email') ); } public function send_emails_to_users() { if(!wp_next_scheduled('cliv_recurring_cron_job')) { wp_schedule_event (time(), 'hourly', 'cliv_recurring_cron_job'); } } public function send_email() { //send email code goes here }

youtube-upload runs from terminal but not cron call

柔情痞子 提交于 2019-12-04 21:22:35
the following is my up427.sh script being called from cron under ubuntu 12.06 on digitalocean server droplet. the script runs and uploads to youtube from the terminal on that droplet with bash up427.sh but not when bash up427.sh is done from crontab on that droplet it echos a error 126 to the error out file i have made called cx.txt I know that means 126 Command invoked cannot execute /dev/null Permission problem or command is not an executable keep in mind it does run when i run bash up427.sh from the droplet terminal and it works and uploads to youtube so the sh command and syntax are

How to work with cron job in zendframework 2? [duplicate]

最后都变了- 提交于 2019-12-04 19:43:33
This question already has answers here : How to run cron job with zend framework 2 (2 answers) Closed 6 years ago . I have two functions in zend framework 2, which fetch me the details of apartments from another site and save them in my data base. (BUT THEY DO SO ONLY WHEN I RUN THE FUNCTIONS). say the controller name is 'FetchFromSourceController' and the functions are 'index' and 'ical'. those are the names I used. But my requirement is those two functions should run automatically one after the other when the day begins, with a gap of 10 minutes. i.e. index action should run at 12:00 AM and

Cloud Functions for Firebase based timer

試著忘記壹切 提交于 2019-12-04 17:09:06
So I know that Cloud Functions for Firebase don't natively support cron jobs, and one have to depend on an external source to trigger an HTTP cloud function. But I don't think this will work in my case. I have an app in which users can create competitions that end in 24 hours, thus each time a competition is created, I need to set up a timer that triggers one time after 24 hours. Do you guys have any idea on how this problem can be approached? At this moment the solution that the Firebase guys are providing for solving the cron issue is to use Google App Engine to deploy a server and trigger

crontab issue when using exec php script?

风格不统一 提交于 2019-12-04 16:37:40
I am using elementaryOS (base on ubuntu) When I run commaand line: kn3l@kn3l:/var/www/cronjob$ 25 15 * * * /var/www/cronjob/helloworld.php > /var/www/cronjob/cron.log and it works for crontab with terminal command line. BUT When I using PHP with my code like this (test.php): -rwxrwxrwx 1 kn3l kn3l 47 Jun 6 14:59 test.php* test.php <?php $output = shell_exec('crontab -l'); echo "<pre>$output</pre>"; I go to http://localhost/test.php Why I did not see any return like the command line? Anyone could help me? fedorqui You have in your user crontab the following line: 25 15 * * * /var/www/cronjob

Getting cron job error because of <?php tag

浪尽此生 提交于 2019-12-04 11:59:33
I've set up a cron job to run. It executes a php file which is named cronj.php But it doesn't work and cron job notification I get is: /root/website/myworld/blabla/cronj.php: line 1: ?php: No such file or directory And line 1 in that file is simply a php tag <?php I don't know how Cron is executing the file as if it was a shell script. Normally you would put in a shebang line (like #!/usr/bin/env php ) at the top of the file so that the shell knows how to invoke it, but PHP doesn't like it - as it outputs everything outside its tags. Thus, instead of this: 0 3 * * * /mypath/myscript.php ...

logrotate cron job not rotating certain logs

廉价感情. 提交于 2019-12-04 09:11:23
问题 I added two scripts in "logrotate.d" directory for my application logs to be rotated. This is the config for one of them: <myLogFilePath> { compress copytruncate delaycompress dateext missingok notifempty daily rotate 30 } There is a "logrotate" script in "cron.daily" directory (which seems to be running daily as per cron logs): #!/bin/sh echo "logrotate_test" >>/tmp/logrotate_test #/usr/sbin/logrotate /etc/logrotate.conf >/dev/null 2>&1 /usr/sbin/logrotate -v /etc/logrotate.conf &>>/root

How to design a distributed job scheduler? [closed]

巧了我就是萌 提交于 2019-12-04 04:59:04
I want to design a job scheduler cluster, which contains several hosts to do cron job scheduling. For example, a job which needs run every 5 minutes is submitted to the cluster, the cluster should point out which host to fire next run, making sure: Disaster tolerance: if not all of the hosts are down, the job should be fired successfully. Validity: only one host to fire next job run. Due to disaster tolerance, job cannot bind to a specific host. One way is all the hosts polling a DB table(certainly with lock), this guaranteed only one host gets the next job run. Since it often locks table, is