Questions tagged [cron]
Cron is a job scheduler that allows users to run commands periodically.
2,337
questions
0
votes
0
answers
94
views
How to extract timing info from crontab?
I have a crontab entry and would like to extract timing info from it. The goal is to know the frequency of bash script execution which will be executed by crontab. This info will be used for further ...
0
votes
1
answer
39
views
clamtk does not redirect stdout for its cron job
I have noticed that clamtk only redirects stderr to /dev/null and not stdout.
if I change the cronjob it creates to also redirect stdout, will that effect the log file it creates?
I want to use the ...
2
votes
1
answer
184
views
Using HOME variable in crontab result in broken jobs
I have this crontab file with a lot (100+) of jobs that execute some commands in the same directory, suppose ~/Documents/. Instead of cd ~/Documents/ && <command> for every jobs, I can ...
2
votes
1
answer
3k
views
Debian 11 (bullseye): user cron jobs not running
I have a server that I am hosting at home using a residential ISP that issues public IP addresses via DHCP--that is to say, I don't always get the same IP back when my DCHP lease renews. I created a ...
0
votes
1
answer
190
views
Cron expression at 11h30 and 19h every day
I would like to make a cron expression that runs at 11:30 a.m. and 7 p.m. every day.
But 0 30 11,19 ? * * * runs at 11h30 and 19h30
And 0 30,0 11,19 ? * * * runs at 11h, 11h30, 19h and 19h30
How can I ...
0
votes
1
answer
565
views
Cron schedule on last 2 days of 1st and 3rd week of every month
Can I get help composing a cron schedule? The schedule is supposed to run a command at the following times:
last 2 days of 1st week of every month
last 2 days of 3rd week of every month
0
votes
1
answer
415
views
Wake up / CRON on Mac
I have an old iMac running macOS Catalina. I've scheduled 2 CRON jobs, one running in the morning (say, 8am) and one running in the afternoon (say, 5pm). The CRON jobs run a few R scripts, in case ...
0
votes
0
answers
29
views
Crontab only recording partial output
I've set up a cron task to run my script called outcam.sh. This script opens a camera, prints "Program launched" and records a .dat file for every frame. It will also output a line of text ...
0
votes
1
answer
187
views
File is not readable when script is called by cron
This really has me scratching my head. I have a PERL script on a RHEL 7 server that creates an xlsx file via MIME::Lite and emails it to several people. If I run the script from the command line it ...
1
vote
1
answer
229
views
How does cron know what MTA to use?
How does cron know what MTA to use? Where is this info stored please? (Using Ubuntu KK.)
Edit: Here's the whole story: I enabled the MAILTO option in crontab, and scheduled some task. When the task ...
0
votes
1
answer
136
views
Cron not firing properly
I have a cron job that is supposed to execute a bash script. I have confirmed the bash script does work as the cron job works properly on my local machine.
However the cron job does not appear to be ...
0
votes
2
answers
492
views
How to exit "wall" without pressing Ctrl+D? [closed]
I'm using crontab to send messages to all users.
I wrote
*/1 * * * * wall $(bash some_shell_script.sh)
But the problem is I always have to press Ctrl+D to end the message.
How can I solve this??
1
vote
1
answer
2k
views
nmcli Error: Connection activation failed: Not authorized to control networking
I wrote a combination .sh and .exp scripts that:
activate vpn connection
connect to remote server
download some files from server
deactivate vpn connection
This scripts should run on schedule.
I use ...
0
votes
2
answers
93
views
Unable to uncomment just the cron by matching the string MYAPP
Below is my existing cron which i wish to enable
crontab -l
####Cron to auto restart MYAPP
###*/15 * * * * ansible-playbook /web/playbooks/detectMYAPP/va_action.yml | tee -a /web/playbooks/...
0
votes
1
answer
87
views
what is the syntax of jobs.deny?
from man it said
The execution of files can be allowed or denied by creating file jobs.allow or jobs.deny which worked similar as other allow/deny config files
But the example has something like ...
1
vote
0
answers
129
views
Trouble with starting emacs daemon using crontab's @reboot
I'm trying to configure my system to start emacs -daemon when I start the system. So, I've added following line to my crontab.
@reboot /usr/bin/emacs -daemon
And then when I start my system, It seems ...
0
votes
2
answers
202
views
Backup fails when sudo runs rclone during an anacron job
I have created a simple backup script that creates .tar.gz of all my important folders and upload it to Google Drive using rclone.
Everything works perfectly fine when I run the script manually. But ...
0
votes
1
answer
564
views
how to NOT show syslog info messages on terminal TTY
I have a home media server in the kitchen (OMV / Debian). I have one physical terminal open - display and keyboard running musikcube player that shows browses and plays the music library. Looks very ...
0
votes
1
answer
126
views
How to turn off crontab logging on Linux Mint 21
Every minute I was running my rather silly shell script to ensure my CPU governor is set to powersave. It was an experiment, for the lack of a better word. I forgot about it,... until now when I saw ...
0
votes
2
answers
203
views
RHEL7 Cron entry gives ambiguous redirect error? [duplicate]
We have a crontab entry that ends up sending an ambiguous redirect error. Pretty sure it's the command to read the date, but don't know how to fix. Are there other solutions?
/bin/sh redirects to /bin/...
-1
votes
3
answers
645
views
How can I use $(pwd) in a bash script run via crontab?
I have a script named Run_at_startup.sh, which contains the following line:
/bin/bash "$(pwd)/Testing_3.sh"
If I manually run Run_at_startup.sh, Testing_3.sh will be run properly. However, ...
1
vote
2
answers
407
views
How to start a screen with crontab
sudo Crontab -e
15 0 * * 1-5 /usr/bin/screen -S wake_up -d -m /home/pi/auto/wake_up.py
But at 00:15 there is no screen started...
This command: (worked in terminal)
screen -S wake_up -d -m /home/pi/...
1
vote
2
answers
79
views
Crontab Enhancement [closed]
I have 31 cronjobs in a crontab and I changed the dates every week after first 7 cronjobs is done. Is there an alternative to reduce this manual work?
I tried to set specific dates for each cronjob.
...
0
votes
1
answer
562
views
Error when installing package "crontab" on Beaglebone Black (Debian Buster)
I am working on a project regarding autorunning a pythonscript on boot, on a Beaglebone Black Rev. C, running BeagleBoard.org Debian Buster IoT Image 2020-04-06.
I am trying to follow the first part ...
0
votes
1
answer
192
views
crontab arguments
I understand that crontab -e is used to edit the current crontab.
If i create a file named abc and put a cron command in it and type crontab abc, I believe this is to set the current cron file to the ...
0
votes
2
answers
296
views
Command runs manually successfully, but fails quietly in cronjob
I'm running this as a cron job:
( export PATH='/usr/bin:/bin' && echo "$PATH" && wget "https://www.mahmansystems.com.au/WSDataFeed.asmx/DownLoad?CustomerCode=%2F&...
0
votes
1
answer
150
views
Log the error for a whole && chain of commands (in Cron jobs)
In one of my cronjobs, I have a long &&-chained command, at the end of which, I put 2>>/home/myparadise/public_html/wp-content/uploads/import/files/raytheon/raytheon_log_error.txt - ...
0
votes
2
answers
121
views
Pipe command output from a CRONTAB job deleting files more that 5 days old [closed]
I would like to run a CRONTAB job to delete files older than 5 days in a folder AND pipe the command output to a file in case of errors.
This command deletes the files when run from a command line:
/...
0
votes
0
answers
34
views
How can I make www-data's cronjobs to be executed?
I do have a server managed with Django which has Python-Crontab installed on it. Due to Django being executed by www-data user, all the Python-Crontab jobs I'm saving are being written on www-data's ...
2
votes
2
answers
527
views
Why can't play music at reboot?
OS info:
uname -a
Linux debian 5.10.0-18-amd64 #1 SMP Debian 5.10.140-1 (2022-09-02) x86_64 GNU/Linux
I want to play music at reboot.
sudo crontab -e
@reboot /usr/bin/sleep 200;/usr/bin/mplayer /...
1
vote
2
answers
70
views
Repeating perl script every 5 days, not nth day of month
I currently have one perl script that is used to make a memory intense call to another protocol. This takes approximately 20-25GB ram to complete. And, it takes anywhere from 8 to 15 minutes. Upon ...
0
votes
1
answer
26
views
crontab does not execute nor output send
I'm trying to run a script that archives a dir every day at 10 PM but It is not executed nor logs send. Please advise ..
[root@linux]# crontab -e
0 5 * * 1 /usr/sbin/aide --check
0 22 * * * /root/...
0
votes
1
answer
104
views
Cronjob only on Saturday of first Thursday of the month
I want a cronjob to run only on Saturday of the first Thursday of the month. So the first Thursday of the month it will run on Saturday.
If I wanna run it at 12 on the first Thursday of the month, I ...
0
votes
3
answers
664
views
How can I log shell errors in scripts called by a cron job?
This morning I found a message saying just so:
EDIT: I add the header of the message as well, so it is clear where it came from.
Return-Path: <root@REDACTED>
Received: from localhost (localhost [...
0
votes
1
answer
1k
views
crontab error - SSMTP - 553 5.7.1 Sender address rejected: not owned by user
As root, I installed ssmtp and I configured the /etc/ssmtp/ssmtp.conf as follows:
# Sender email address
[email protected]
# Destination SMTP server and port
mailhub=mail.domain.com:587
# ...
1
vote
1
answer
82
views
This cron script was missed by shutdown
Is there a way to setup cron (or any other scheduler, like anacron) to run such that it checks immediately after I resume working on my laptop (e.g. after suspension or shutdown) whether it has ...
1
vote
1
answer
993
views
Cron output to file immediately
I have a Python program that runs for several hours at a time, and is run by cron:
import time
for _ in range(1000):
print(f'{time.strftime("%r", time.localtime())}')
time....
1
vote
0
answers
222
views
Any way to change rsyslog configuration per user (for cron)?
I am a user without sudo on a CentOS 7 system running rsyslog. I would like to log my cronjobs. Ideally, rsyslog would log all my user's cron activity to somewhere like ~/log/cron.
There are good ...
1
vote
2
answers
298
views
What process is generating dead.letter?
I'm using linux:
Distributor ID: Ubuntu
Description: Ubuntu 18.04.6 LTS
Release: 18.04
Codename: bionic
I noticed a few weeks ago that there is a file in my home directory: dead....
2
votes
1
answer
227
views
zenity failing in crontab but working in shell
I'm trying to run a script that calls zenity from a crontab and it fails. The script works well from the command line.
I do pass the DISPLAY in the crontab:
* * * * * DISPLAY=:1 bin/myscript.sh > /...
1
vote
1
answer
375
views
Config files not being read
This is a super issue weird that I cannot for the life of me figure out, so would be very grateful for assistance.
My home server is an old Mac-Mini with 2 external HDD's in RAID1 using mdadm running ...
0
votes
0
answers
26
views
Issue while moving existed file
I have a script, that does queries to clickhouse stats data that's further used for monitoring.
Every query output is stored to /tmp/file.out.tmp file, and at the end of script that file is renaming ...
0
votes
0
answers
481
views
Troubleshooting extremely shaky setup - Ubuntu kiosk with ubuntu-frame
I have a set of computers at work (running Ubuntu 20.04) that are used to host various containerized applications with Docker, as well as running kiosk screens using ubuntu-frame. To set up and ...
0
votes
2
answers
33
views
Time Limit execution of code for 30 days in Debian on RPI 4
I have to deliver my RPI4 to a customer for trial basis and i want to limit the execution of my code to either 100 times or make it time bound that it wont start after 30 days (a specific date). i ...
2
votes
1
answer
2k
views
Run crontab in America/New_York time zone
We are trying to schedule a script to run at 9am ET every day throughout the year, regardless of daylight savings. On our GCP Compute Engine / Linux Server, cron runs in UTC always. It is easy enough ...
1
vote
1
answer
2k
views
Linux wget -O /dev/null <http....> syntax
At my job we have a Linux server with several cron jobs with the syntax wget -O /dev/null followed immediately by an http request to a PHP file or whatever. So something like wget -O /dev/null "...
1
vote
2
answers
213
views
Delete jobs from at queue on startup
I'm on Ubuntu 18.04.6 LTS and I have a cronjob that schedules automatic shutdown commands to a specific at queue every minute:
$ crontab -e
*/1 * * * * [ -z "$(w -h)" ] && echo "...
0
votes
1
answer
85
views
Root cronjobs not running
This is driving me nuts! I cannot have the job in the root crontab to run. This is what I have in the crontab:
5 * * * * /usr/bin/python3 /root/turf/recevoir_les_cotes.py
1 * * * * date >> /root/...
1
vote
1
answer
1k
views
Allow 'crontab -l -u' for non-root users
I have two users: user1 and user2
user1 is added to /etc/cron.allow
But when I run crontab with the -u option, I get :
user1@hostname:~$ crontab -l -u user2
must be privileged to use -
Is it possible ...
-1
votes
2
answers
38
views
How does CronJobs understand that the first word is user or command?
When we write in the cronjobs file:
* * * * * foo bar
How does the system know that foo is a user that you need to execute the bar command, or that foo is a command for which bar is an input ...