cron-task

Constantly monitor a program/process using Python

与世无争的帅哥 提交于 2020-01-12 07:37:06
问题 I am trying to constantly monitor a process which is basically a Python program. If the program stops, then I have to start the program again. I am using another Python program to do so. For example, say I have to constantly run a process called run_constantly.py . I initially run this program manually, which writes its process ID to the file "PID" (in the location out/PROCESSID/PID). Now I run another program which has the following code to monitor the program run_constantly.py from a Linux

Cron job in ruby on rails not work

坚强是说给别人听的谎言 提交于 2020-01-06 04:47:07
问题 I followed the railscast http://railscasts.com/episodes/164-cron-in-ruby but I cant seem to make it worked. I have schedule.rb in my config. I wished to refresh my Database.count everyday in my homepage. I cannot find the deploy.rb in my folder. Where is it? For testing purpose, I changed it to every 2 seconds. [schedule.rb] every '2 * * * *' do rake "pages_controller:home" end [pages_controller.rb] class PagesController < ApplicationController def home @title = "Home" @companies = Company

How to use perl to modify crontab? [closed]

时光毁灭记忆、已成空白 提交于 2020-01-05 00:49:28
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . How could I append a cron task in crontab via a perl script? I thought of the following: #!/usr/bin/perl use strict; use warnings; `crontab<<EOL 00 * * * * /home/slynux/download.sh EOL` I don't want to mess up things, so am I on the right track? Also if I append it, how would I remove it? I am new in Perl 回答1:

How to design a distributed job scheduler? [closed]

╄→尐↘猪︶ㄣ 提交于 2020-01-01 09:04:12
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . 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

How to run a cron job at every 5 hour interval

[亡魂溺海] 提交于 2019-12-31 07:09:25
问题 How to run a Cron job at every 5 hour interval? I've tried this 0 */5 * * * /path/to/script/script.sh (Not necessarily a shell script) But the problem with this expression is it'll run every 5 hour but the clock will reset at midnight 00:00:00 everyday. Explanation: if the job executes at midnight 00:00:00 then following will be the execution timing 00:00:00, 05:00:00, 10:00:00, 15:00:00, 20:00:00 after 20:00:00 the job will execute at 00:00:00 which is 1 hour earlier than specified. But my

solution for scheduled uploads - cron job?

Deadly 提交于 2019-12-25 05:27:10
问题 I'm trying to find the best solution for scheduling uploads to my server to specific directories. initially uploading the content pushing it live at the defined time I've heard cron job recommended, but I've no idea how to use such a thing. I'm trying to upload .html, .php, and .jpg files to multiple different directories all at the same future time. I'm using Linux, cPanel, PHP. Typical LAMP stack + cPanel. Any input is appreciated. 回答1: cron is really easy. To edit the jobs type crontab -e

Cron task python script not working

瘦欲@ 提交于 2019-12-25 02:57:34
问题 I have a python script I want to fire off every night at midnight. I'm using cron scheduler right now to do so, however, I can't figure out why it's not working. For now, I've been using close times (within the next minute or so) to test the cronjob, but I will ultimately want it to work for midnight. Here is what I put in my crontab file (to run for 2:43pm), hosted on my ubuntu machine: 43 14 * * * root /home/grantmcgovern/Developer/Projects/StudyBug/Main.py I even put the: #!user/bin/python

Ecommerce plugin development - how to periodically check the platform DB and call external API

时光怂恿深爱的人放手 提交于 2019-12-24 22:00:04
问题 I'm developing a module for Prestashop and I'll make a premise valid for Prestashop development environment: a module/plugin can do it's work thanks to some hooks, like Header, or leftBar, or BackOffice header loading, so apparently there is no way to do what I want to do: I want to periodically (let's say each day) check for abandoned cart in Prestashop database and send their information to external API. I thought of a workaround which I don't like very much and it doesn't seem efficient to

Preventing Google App Engine Cron jobs from creating multiple instances (and thus burning through all my instance hours)

℡╲_俬逩灬. 提交于 2019-12-24 08:39:15
问题 Very related to this question (How can I prevent my Google App Engine cron jobs from burning through all my instance hours?), yet unfortunatly I not only experience something similar, in my Cron-jobs in Appengine multiple instances are created, which causes quite a high number of Instance hours to be billed. I tried different intervals to determine whether this has an effect on the instance hours, but cannot determine the difference currently. To illustrate, I got billed App Engine Frontend

How to pass parameter from cron command to codeigniter function?

六月ゝ 毕业季﹏ 提交于 2019-12-23 02:06:17
问题 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