How do I write a bash script to restart a process if it dies?

I have a python script that'll be checking a queue and performing an action on each item: # checkqueue.py while True: check_queue() do_something() How do I write a bash script that will...

How to create a cron job using Bash automatically without the interactive editor?

Does crontab have an argument for creating cron jobs without using the editor (crontab -e). If so, What would be the code create a cronjob from a Bash script?

Is node.js capable of reading from URL?

What I am trying to achieve is to create script which will read from URL and then use this data to do some manipulations. In example. This script will run every 5 minutes, load page from...

Calculate Cron Next Run Time in C#

I have crontab-like scheduler. Time definition "MM HH WD MD M": MM- minutes HH- hours WD- days of week MD - days of month M - months WD, MD and M allow multiple entries and each of params can be...

how to redirect repo sync output into a file

I tried "repo sync 2>&1 > log", but can't get anything in log. The output still gets into the screen directly. "nohup repo sync" does work, output gets into file "nohup.log". But it seems any...

execute crontab twice daily at 00h and 13:30

i want to execute a script twice daily at 00:00 and 13:30 so i write : 0,30 0,13 * * * it seems wrong for me, because like this, the script will fire at 00:00 , 00:30 , 13:00 and 13:30. Any idea ?

Will crontab hour range a-b run after b too?

Say I have a crontab which runs every 20 minutes and I have a hour range which can vary so lets say a-b, which in one example could look like */20 5-23 * * * /usr/bin/cool_program My question...

How do I start cron on docker ubuntu base?

I have installed cron via apt-get install cron Trying to start cron fails (as expected) because of upstart not running. What is the command line for starting cron properly (i.e. it will read...

Execute bash script from url via cron

I am trying to get a cloud server (built from an image I have saved) to execute a script from a URL upon startup, but the script is not executing properly. I used one of the answers from Execute...

Why am I receiving a 'bad hour' error in my cron task?

Why is my cron task giving me a 'bad hour' error. Below is my cron task (mycron.txt): */15 12-00 * * * php mycommand.php: bad hour errors in crontab file, can't install. What I want is to run my...

python TUI popup

I need some hints to find a simple solution for inserting a popup window inside a python console app. This app runs normally unattended, because it's done to be launched from crontab. It uses...

Cron job not auto runs inside a Docker container

I have a LAMP container with supervisor. I add a simple cron * * * * * root /bin/date >> /var/log/cron.log from my Dockerfile ADD ./crons/test /etc/cron.d/test RUN chmod 0777 /etc/cron.d/test I...

Restart pm2 app every 12h with cron

Tried this, but it doesn't work: SHELL=/bin/bash PATH=/usr/lib/node_modules/pm2/bin * 0,12 * * * pm2 restart all What am I doing wrong?

Get celery beat trigger time on task

I'm trying to find a way to get time time condition that triggered celery beat to fire a task. Getting datetime.now() often deviates from the time at which the task was queued by celery beat due...

Connect new celery periodic task in django

It's not a question but help to those who will find that the declaration of periodic tasks described in celery 4.0.1 documentation is hard to integrate in...

Celery beat not sending crontab task when hour is set

I'm using celery 4.1 and all my periodic tasks work correctly except where I set the hour in a crontab task. I was thinking it had something to do with the timezone setting, but I can't seem to...

Best practices to run cron job from a docker stack

here is the thing: I have a stack where a node js backend sends messages to a queue and perl workers (cron jobs) consume messages from that queue. I already "dockerized" the node js backend but...

Authentication issue with cron job on Ubuntu 18.04

I have a clean install of Ubuntu 18.04 and I'm having trouble getting a cron job to execute a script. Crontab -l contains the following: # Edit this file to introduce tasks to be run by cron. # #...

Run Cron as non root user

We use open-shift, and the docker container only could be run as non-root user. However, the cron failed start with error: seteuid: Operation not permitted I have already done the following...

How to run cronjobs on an azure linux hosted webapp?

Crontab command not found on Linux web app on azure,I'm trying to schedule a cronjob for a laravel application. I'm trying to run a cronjob for my laravel web app.The solutions online suggest that...

Configure cron with Ansible

I thought it will be a piece of cake to configure crontab with Ansible cron module, but there is something I can't understand. This is simple task I wrote: - name: Add job triggering logs...

kdevtmpfsi using the entire CPU

We are using an EC2(Ubuntu) amazon instance for running Apache.Recently we noticed that there is a process using the entire CPU. We removed it using the help of the following...

Python script in systemd: virtual environment or real environment

I have been trying to run a python script on start-up (on a Pi). I initially did this via an .sh script triggered by cron. Posting with a problem on StackExchange Pi...

How to keep a Node JS server running on shared hosting

I was looking to test a node server in a shared hosting environment. I'm using an ssh terminal session to test. The server works fine, but of course you can't leave the terminal session without...

Alpine ERROR: unsatisfiable constraints: py3-pandas (missing):

I have the following dockerfile: FROM alpine:latest ADD crontab.txt /crontab.txt ADD script.sh /script.sh COPY entry.sh /entry.sh ADD app /app RUN chmod 755 /script.sh /entry.sh RUN...

Crontab with flask command on Azure App Service with Linux ASP

What I'm trying to do is to run flask command in crontab on Azure App Service with linux App Service Plan. So far I have my startup.sh to setup cron but the command does not execute, nothing in...

How do I run Django Management > Commands as cron jobs in Elastic Beanstalk running nginx

I'm upgrading a Django application from Elastic Beanstalk Python 3.6 running on 64bit Amazon Linux to Python 3.8 running on 64bit Amazon Linux 2 and moving from the Apache server to Nginx. I'm...

run cronitor on raspberry crontab

i'm trying to use cronitor (a server that monitors you cron jobs) on my raspberry pi zero. The installation process for cronitor given in the doc fails when I run the last line: # Install...

Python speedtest.py failing to connect to Internet when run from cron

I have the following code #!/usr/bin/python3.8 import subprocess import requests import datetime import...

Can't get Celery to work on digital ocean droplet with prod settings

It is working fine on local server, but when I try to start a worker after ssh I get an error. /var/www/bin/celery -A stock worker -l info I know DJANGO_SETTINGS_MODULE is set correctly as I...