cron-task

How to pass parameter from cron command to codeigniter function?

无人久伴 提交于 2019-12-23 02:05:34
问题 I am working with code-igniter and running a function from cron job. class event extends CI_Controller { public function newEvent() { //some process here using the parameter } } cron command: * */2 * * * /usr/bin/php /var/www/project/index.php 'event/newEvent/parameter' I want to pass the parameter like written in cron command and do some process with that parameter in newEvent function. What extra code I should write in my function to receive the parameter from cron command. Thanks 回答1: CI

Cloud Functions for Firebase based timer

倾然丶 夕夏残阳落幕 提交于 2019-12-21 21:35:24
问题 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? 回答1: At this moment the solution that the

Setting Cron job to delete file after 24 hours

别来无恙 提交于 2019-12-21 02:36:28
问题 I read all the related questions and was unable to understand them. I am using Plesk CPanel to set cron job as it was advised by everyone. I want to delete all files from a folder after 24 hours. Assume that I have to delete it after every 2 mins (So I can check its working or not). I have two options: Either run a PHP file that deletes all files after 24 hours using a cron job Use the cron job command `rm` to delete all the files I tried both ways and was unable to get my task completed.

How to create cron statement to run for multiple hours

寵の児 提交于 2019-12-18 12:08:48
问题 I need a cron statement to run for few hours eg 1-8 then 10-15. In this case will the following statement work, 0 1-8,10-15 * * * If not can anyone help me? Thanks in advance, Gnik 回答1: You cannot, you can use either multiple values OR a range 0 1,2,3,4,5,6,7,8,10,11,12,13,14,15 * * * Source: Time tags are separated by spaces. Do not use spaces within a tag, this will confuse cron. All five tags must be present. They are a logical AND of each other. There is another space between the last

CakePHP 2.3.8: Calling Another Controller function in CronController.php

百般思念 提交于 2019-12-18 04:15:22
问题 For CakePHP 2.3.8 How can I call Another Controller function in CronController.php Any ideas? 回答1: Below is the code: App::import('Controller', 'Products'); // mention at top // Instantiation // mention within cron function $Products = new ProductsController; // Call a method from $Products->ControllerFunction(); Hope it helps some one ! 回答2: Use the $this->requestAction(); method in your controller action. It's not the most recommended pattern, but it can be useful and can return data or

Cron job for running task every second week

二次信任 提交于 2019-12-13 03:54:17
问题 I want to create cron job for external application to run every second week starting from Thursday Eg - 9:00 pm,23/5/2019 9:00 pm,6/6/2019 Cron Expression which I can modify 0 0 0 0 0 0 Minute | Hour | Day of Month | Month | Day of Week | Year I already tried different combinations but not able to receive this functionality Site I used https://crontab.guru/ Cron Expression 0 0 0 0 0 0 Minute | Hour | Day of Month | Month | Day of Week | Year 回答1: There is no exact method to run the script

youtube-upload runs from terminal but not cron call

三世轮回 提交于 2019-12-12 09:27:32
问题 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

How to set a Cron job in Every two hour from 10-19

喜你入骨 提交于 2019-12-12 07:04:54
问题 I had a question before 1 month regarding this. that was the interval of 1 hour and i got exact answer. below is the link to the old question How to set a Cron job in Every one hour from 9:00 am to 6:00 pm ( Monday to Friday ) Thank you Stack Over Flow and the contributor Andy Holmes Now I got a new requirement on Cron expression, the same way i need it in every 2 hour. I have tried 0 9/2-18/2 * * 1-5 and 0 (9-18)/2 * * 1-5 But that doesn't help, Please help me 回答1: Use: 0 10-18/2 * * 1-5 You

How do i activate cron command once within specific time frame?

北战南征 提交于 2019-12-12 05:22:14
问题 Basic information about my system: I have a music system where people can schedule songs to start and end at a specific time. OS: Arch linux It sets two crons at the moment. One lets say at 1.50 (start time with a command like "play etc") and another set at 3.20 (end time with a command like "end etc"). My setup works perfectly and i can end delete schedules etc etc but i now noticed an issue! If i set the above times and turn the system off (My system is a raspberry pi) and turn back on at

Preventing multiple executions

一世执手 提交于 2019-12-11 12:07:34
问题 I have this Django cron job script (I am using kronos for that, which is great). Since I trigger this job every minute, I want to make sure that there isn't another instance of the script already running. If there is a previous job running, then I want to skip the current execution. I know I can do that with a lock file, but that's not very reliable and can cause problems when you reboot in the middle of an execution (you have to clear the lock file), etc. What's the best way to do this using