Questions tagged [cron]

Cron is a time-based job scheduler in Unix-like computer operating systems. Cron enables users to schedule jobs (commands or shell scripts) to run periodically at certain times or dates.

288 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3 votes
0 answers
181 views

Desktop notifications for failed cron jobs on Ubuntu/Unity

How can I receive notifications of failed cron jobs via my Unity desktop environment? The age-old solution of having cron send emails is problematic as my ISP doesn't provide an SMTP server, and it's ...
sircolinton's user avatar
2 votes
1 answer
1k views

Run cron job in UTC when my server is in a different timezone

My server runs in the GMT timezone, which means it switches to British Summer Time in the summer. I want a cron job to run in UTC as it accesses an external service that runs in that timezone. i.e. In ...
Julian7's user avatar
  • 21
2 votes
0 answers
100 views

zfs diff gives error on encrypted dataset (Key must be loaded to discover path names: Permission denied)

I'm running the following on Debian 10: zfs-0.8.4-2~bpo10+1 zfs-kmod-0.8.4-2~bpo10+1 I have a 2TB (passphrase encrypted) dataset used by many colleagues. I am also using Zabbix for monitoring, and ...
Oleg's user avatar
  • 413
2 votes
2 answers
2k views

Cron job once in three days

In linux ec2 instance i want to run a cron job 3 Days once to automate a process once in three days as a sudo user in my linux ec2 instance. Can anyone help me out with the cron.
Manikandan Ram's user avatar
2 votes
1 answer
1k views

Repeating script every 5 seconds not overlapping existing runs with crontab and watch

I know crontab can only schedule tasks down to the minute and to schedule something more often than 60 seconds another method has to be chosen. My understanding is watch will wait for the process to ...
Brian's user avatar
  • 133
2 votes
0 answers
303 views

Attempting to delete cron directory in docker gives "Invalid argument"

I'm trying to write a hardening script to remove the cron directory in an alpine Linux based docker image. docker run -it alpine:3.7 rm -rf /var/spool/cron rm: can't remove '/var/spool/cron': Invalid ...
Daniel Powell's user avatar
2 votes
0 answers
909 views

Cron not logrotating for cron.daily

I'm running a rhel7 server and I have a rsyslog logrotate config file that doesn't seem to run using cron job. It will only work if i run it manually Troubleshooting steps i took: logrotate -df /etc/...
stiffy's user avatar
  • 23
2 votes
0 answers
735 views

Elastic Beanstalk and Worker Tier? (PHP)

I'm trying to setup my app that's hosted on EB with a worker that will run some basic cron jobs to feed an RDS database with data that the app consumes. I deployed this cron.yamlat first: version: 1 ...
INT's user avatar
  • 121
2 votes
0 answers
133 views

How to aggregate a large cron mail volume

How do you handle a large volume of cron mails (from a thousand servers) in a smart way? Main use case: a cron error comes in, but its severity does not warrant immediate action. However, I do not ...
Willem's user avatar
  • 2,922
2 votes
0 answers
1k views

cron.weekly runs on wrong day of week on Ubuntu

I have this line in my /etc/crontab: 47 6 * * Sat root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) So the cron.weekly should be started every Saturday ...
valk's user avatar
  • 507
2 votes
2 answers
3k views

Cron getting timeout when attempting to access url (wget).

I'm sure this is simple and I've been digging but no answer is quite as specific as I need it to be. The goal is easy, have Cron hit a url on my server every 5 minutes. All of that is set up and ...
user2543853's user avatar
1 vote
0 answers
44 views

crontab -> shellscript -> docker -> redirect output to localfile

I am currently switching from rsync to a borg based backup. Everything is working, except getting the output of borg to my logfile. My setup is as follows: I am trying to do everything in docker to ...
peez80's user avatar
  • 191
1 vote
0 answers
87 views

gsutil fails with "OSError: Operation not permitted" when running from cron

I have a php script that does backups. The backups have been failing, because one of the first commands throws an error and stops the script. When I run the script in the terminal, it works just fine. ...
Kenny Wyland's user avatar
1 vote
1 answer
151 views

CentOS scheduled OOH restart of service

I would like to schedule a one-off OOH restart of a service using cron. Can I just add something like: /usr/sbin/service myservicenamehere restart ... in the crontab, to run once?
btongeorge's user avatar
1 vote
0 answers
770 views

Cron not working after pam customization to check groups

I need help with a PAM configuration. I've a Debian 11.5 machine with kerberos connected to an MS AD server. I want to configure the machine in order to allow some AD user to login, filtering them by ...
Lorenzo Sorace's user avatar
1 vote
1 answer
28 views

Crond Inactive Every Other Minute

I have a problem with crond (dated 13Feb21) on my Slackware 14.2 x86_64 (Linux version 5.12.10) server. I have a script that crond runs every minute that accesses an external device for current data ...
PK232's user avatar
  • 11
1 vote
1 answer
768 views

start-stop-daemon: command not found . This error only occurs at boot time in a cron job

I have scheduled an @reboot cron job to start a service in /etc/init.d After boot, service is not started when I reach shell command line. The contents of /var/log/cron show the following, 2022-09-...
Ksenia Semenova's user avatar
1 vote
1 answer
108 views

Hosting resource intensive PHP cron jobs

My website is currently running on a VPS. To make the site work, I have a number of resource intensive cron jobs - and when they are running, my site stop responding/becomes incredible slow. I'm ...
Mads's user avatar
  • 11
1 vote
0 answers
118 views

Generating Message-ID for mails sent by crond

On my NixOS installation I have Vixie cron installed, that runs regular jobs. The output for the scripts that are run is sent by e-mail using a ssmtp on the same host, that forwards the mails to my ...
Matthias Wimmer's user avatar
1 vote
1 answer
3k views

Ubuntu 20.04 cron jobs doesn't work when a specific time was added

I had a strange behavior in Ubuntu 20.04 cron job: * * * * * echo "Hello world!" >> /tmp/hello.log 2>&1 <---working with logs 5 10 * * * echo "Hello world!" >&...
Freeman di's user avatar
1 vote
0 answers
1k views

Crontab not running @reboot

I have ubuntu server with crontab that is supposed to run mkdocs in tmux at reboot. Worth noting is that I configure crontab by going into crontab -e. Line is: @reboot /usr/bin/tmux new-session -d -s &...
Perovic 's user avatar
1 vote
1 answer
2k views

docker postgres backup creates an empty file when run as a cron job

I'm trying to create a cronjob that creates db backups every night. My crontab has the job: * * * * * /home/user/scripts/backup.sh (have it set to go off every min for testing) In backup.sh, I have: ...
Ethan Solomon's user avatar
1 vote
0 answers
134 views

Generate systemd task on the fly

I'm writing a script to backup each mysql databases separately on from a mysql server, but instead of handling this inside the script I would like to rely on systemd to generate a backup job to get ...
Baptiste Mille-Mathias's user avatar
1 vote
1 answer
562 views

Logrotate Says It Rotated Logs, But Didn't

OK, here's my situation. I'm trying to use logrotate to rotate VNC logs for a specific user on an hourly basis. Based on the feedback I get when I run the utility, the log rotation goes off, but ...
Jeff D.'s user avatar
  • 11
1 vote
0 answers
2k views

starting cron service fails with code=exited, status=203/EXEC

I just noticed that my server's cron service is not running. I only have 1 script to run via cronjob and when I added it, it was not executing. Already tried to execute the script manually and there ...
Jero Dungog's user avatar
1 vote
0 answers
184 views

Zimbra sends alarms for service restarts by its cronjobs

I'm trying to solve an issue where we get ~8 nightly mails from Zimbra OSE 8. They'll look i.e. like this one: Dec 21 00:46:15 hostname zmconfigd[16202]: Service status change: exhostname amavis ...
Florian Heigl's user avatar
1 vote
1 answer
445 views

dovecot - changing inbox folder or move inbox mail for one user

I am trying to change where dovecot places new incoming emails from the inbox, to another folder, which i've named PreInbox OR I'd like to move all emails from inbox to PreInbox via cron or something. ...
lemonskunnk's user avatar
1 vote
1 answer
767 views

Append to crontab only if entry does not exist

I am looking for a programmatic way to append to crontab only if the entry does not exist. Also, the exit code must be 0 for both cases where the entry does not exist, or the entry exists. I tried: (...
Justin's user avatar
  • 5,438
1 vote
1 answer
129 views

How I can continuously log processes connected to a socket

I have a project with an architecture based on a RabbitMQ queue. Each day at 00:30 triggered by a CRON job, the producer process gets the information from a web page and writes in the queue in order ...
mapedraza's user avatar
1 vote
0 answers
2k views

rsync failed to set permissions: operation not permitted

I am trying to replicate my domains group policy from my primary domain controller to my secondary domain controller. When I run the below command which I used from techmint https://www.tecmint.com/...
Hazmat480's user avatar
1 vote
0 answers
532 views

I cannot edit my crontab in Ubuntu after saving the file

Edited Why would the below command cause crontab -e to show permission denied errors? /bin/sh /var/www/ers-api-proxy/backup.sh 1> /var/www/ers-api-proxy/log.txt 2> /var/www/ers-api-proxy/err....
Blake Bell's user avatar
1 vote
1 answer
916 views

Stop/Delay cron on EC2 instance startup

We are running a set of cron jobs on an EC2 instance. We have two instance A and B in our deployment. Both A and B have Cron jobs that run on startup. We want to disable cron on B on startup until we ...
boygenius's user avatar
1 vote
0 answers
273 views

Why does SSH return an incomplete Cisco running config when called with cron?

I'm trying to automatically download Cisco switch configuration every night to put it under version control. The command I'm using to test this is ssh -vvv -t -t -o nethelp@switch 'show running-...
user211195's user avatar
1 vote
0 answers
1k views

TMUX not creating sessions from CRONTAB

I'm having a heck of a time getting a tmux session to be created from a script executed by crontab. The script executes and the session is created without fail from just running it but if I run it ...
Tyler C's user avatar
  • 119
1 vote
2 answers
1k views

Configure cron jobs for the chrooted user

I've configured chrooted SSH user on CentOS 7. Mounted /proc, /dev, /dev/pts to the user and installed required packages. And now I want to allow cron jobs for this user. How can I solve the task? ...
kurgulus's user avatar
1 vote
0 answers
417 views

crontab error "lstat: No such file or directory", after quit sudo crontab -e, without cron job modification

I checked list of my cronjobs, using this command: $ sudo crontab -e After finished, I quit using :q vim command. :q After that, vi/vim editor successfully exit, but this error occurred: lstat: ...
Iwanio's user avatar
  • 11
1 vote
0 answers
1k views

AWS Cron Expression - all days @ 11pm but except last day of the month

I want to write a expression which I want to execute everyday @ 11pm but except last day of the months. Almost I tried all website I dont get answer to this - saying except last day of the month, it ...
Kannan Samynathan's user avatar
1 vote
0 answers
1k views

yum-cron Job 'cron.daily' locked by another anacron

We have a number of machines using yum-cron and an internal mirror server to keep up-to-date. Some of them will send an email letting us know the updates will be (have been) applied but don't receive ...
Johnny Doe's user avatar
1 vote
0 answers
337 views

Need help killing psuedo terminals

I have a ubuntu web server that uses a chron job to connected to a third party sftp, pull a file and disconnect. This was working for a few weeks and has stopped. I tried to manually SSH into the ...
benikens's user avatar
  • 319
1 vote
0 answers
131 views

Set up email server for cron job

So I've been running a cron job on a daily basis and I set it up with the MAILTO variable so that I receive an email with the error output if the command ever fails. It was working fine up until today,...
ARR's user avatar
  • 11
1 vote
0 answers
156 views

PhP Session Destruction not as eXpected

I have added this code to the top of my page and it is executed when a user login. <?php $lifetime=86400;session_start();setcookie(session_name(),session_id(),time()+$lifetime,"/","","TRUE","...
boonu's user avatar
  • 111
1 vote
0 answers
51 views

Multi VPS: Best practice for semi-automated upgrades?

I've got many virtual private servers, each needing some apt-get upgrade -y lovin' from time to time. (Ubuntu 18.04) Problems I face: I don't have time to upgrade each one manually. I don't want to ...
Jesse's user avatar
  • 245
1 vote
0 answers
5k views

Running 'cron -f' as an unpriviledged user in docker: /var/run/crond.pid: Permission denied

I want to create a docker container with a node application which runs on a schedule. I'm attempting to have cron running in the foreground in the container and periodically start the application. ...
Christian Eriksson's user avatar
1 vote
1 answer
987 views

Log rotation not happening with cron job- files are symlinked and forceful log rotation works

I am facing issue with logrotation with 2 of my custom files. The folder where they reside - /var/log/test is symlinked to /sample/var/log/test cron.daily log which picks up logrotate: Sep 12 03:20:...
Jayanthimala Jayakumar's user avatar
1 vote
3 answers
817 views

If run as a cronjob my shell script doesn't launch a screen

Please have a look at the following simple shell script startCleanup.sh: #!/bin/sh screen -d -m -S cleaner /usr/bin/python3 /opt/cleanup.py My crontab looks like this: * * * * * /opt/startCleanup....
toom's user avatar
  • 227
1 vote
1 answer
3k views

Host Key verification failed SSH Rsync

Two days ago I started using SSH to transfer backups of two Linux servers to another one. I created a shell script to run it in Crontab. Both servers are using Ubuntu 14.04.5 LTS My SQL-Server ...
Rafael Hernandez's user avatar
1 vote
1 answer
599 views

CentOS - Duplicate yum-cron-hourly processes

yum-cron-hourly.conf is run hourly, the default, and I'm not sure its working correctly. There are multiple procs running. root 17320 17306 0 16:01 ? 00:00:00 /usr/bin/python -tt /usr/sbin/yum-...
D.Fitz's user avatar
  • 190
1 vote
0 answers
2k views

Ensure a Jenkins job runs once on or after the specified cron time - even if Jenkins were not running at the specified cron time

I have two things which are not immediately compatible: The old stuff: Several Jenkins Build-server jobs that must be performed, once or several times daily, currently configured with the cron to ...
fsteff's user avatar
  • 161
1 vote
0 answers
206 views

Cron job not deleting files in cifs mount

I have a cron job that runs a shell script. The contents of the shell script is as follows: #!/bin/bash cd sudo service confluence stop NOW=$(date +"%Y%m%d-%H%M%S") mkdir Backup/db mkdir Backup/...
Justin Kredible's user avatar
1 vote
1 answer
724 views

Centos7 cgroups, limit cpu shares for cronjobs

Is it possible to limit the cpu shares for processes started from cron? Background: We have shared hosting on Centos7 and customers can make cronjobs via directadmin controlpanel. Sometimes these ...
Vincent's user avatar
  • 291

1
2 3 4 5 6