All Questions
500
questions
0
votes
0
answers
109
views
How to make a cron job with random offset
I have many services that need perform a sync job every 10 minutes, since these containers are using a shared resource it is not desirable, that they all do the syncing at the same time. I want to ...
1
vote
1
answer
132
views
How to have an environment variable with quotes in crontab
I have a minimum example of my problem, which is trying to install a crontab that looks like this:
FOO="foo\"bar\"bin"
0 0 1 * * ls
by running crontab crontab (I have it in a ...
0
votes
1
answer
98
views
Are there any downsides to making a crontab update for an operating system? [closed]
If I have an application hosted on my server, I would like to automatized as most as possible. If it's not recommended, are there any other solutions except from doing it manually?
0
votes
1
answer
1k
views
CRON: Difference between "At minute 0" and "Every 60 minute"
What is the difference between "At minute 0": 0 * * * *
and "Every 60 minute": 0/60 * * * *
Are these two represent the same schedule? I need to start job at the beginning of ...
0
votes
0
answers
61
views
Append list of logged in users to a log file using crontab?
I need to create a basic log file through the use of a crontab job that appends a timestamp, followed by a list of logged in users. It must be at 23:59 each night.
(I have used 18 18 * * * as an ...
0
votes
0
answers
476
views
How to run tail and grep in a crontab
I am trying to run a tail and grep command that gets the last 10 lines containing Error in all logfiles in the folderevery minute using crontab and fill a text file with the output. The line below is ...
-2
votes
1
answer
146
views
How do I create a crontab job in unix that will move all files in my home directory to another directory at a specific time/date?
Hello I'm new to Unix and I am trying to create a crontab job that moves all the files I have in my home directory where the name contains the letter f followed by a digit 1,3 or 7 to a directory ...
3
votes
1
answer
44
views
Synchronizing two different process starting at the same time
I have a two separate cron services both of which trigger the same python script. I want only one of the invocation to execute and the other one should exit. Is there any way we can achieve this ...
1
vote
1
answer
248
views
cron python script logging messages syslog
I use cron to control a python script
*/10 * * * * /usr/bin/python3 /home/user/FillDatabase.py
and its works well so fare.
The python script itself produce logging in case of error.
import logging
......
0
votes
1
answer
117
views
How do i move all csv files starting from specific characters and modified in a specific week to another path?
I have a directory with multiple files (say /home/initialdirectory) that has:
C-2343.csv
F-4455.csv
G-4433.txt
C-8788.csv
I want to move all .csv files that were modified between Monday 0:00:00 and ...
0
votes
1
answer
244
views
Why node script runs from command but gives error when scheduled from cronjob?
I am in macos and scheduled a node script as a cronjob. I am saving the logs of the cronjob to a file. When the script is executed from shell manually with same command I've in cronjob, it executes ...
0
votes
1
answer
127
views
Crontab not triggering execution when installed during AWS CentsOS EC2 bootstrap
I am deploying a cron file abcd.cron in /etc/cron.d/ location during EC2 bootstrap time using Cloudformation user-data(Uses clod-init). This is not triggering the execution(Checked /var/log/cron log ...
0
votes
1
answer
123
views
Write and schedule a job on Unix server which is triggered even after the server restart
I'm trying to create a task on Unix similar to a task of Task Scheduler in Windows which will run at specific times of the day and even gets triggered after server restarts. Aim of this job is to ...
5
votes
1
answer
2k
views
docker: command not found if called in a cronjob
On my server (QNAP) I can run docker:
$ docker -v
Docker version 20.10.11-qnap6, build 90a753c
If I want to run the same docker command in a crontab
$ sudo crontab -e
* * * * * docker -v >> /...
0
votes
0
answers
53
views
How to source an env file and then execute Python script via cronjob? [duplicate]
I have several python apps.
To run these apps, I must 1st execute the virtual environment by issuing the following command:
source venv/bin/activate
I need to run these files using a cronjob (on Unix)...