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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
19 views

Script run from crontab doesn't work [duplicate]

Running on the server I have a command that is started at boot as a service and it works well, now if I run the command that gives me information on the status of the service I get the data view, if I ...
Canuto's user avatar
  • 1
0 votes
2 answers
84 views

Splunk Enterprise - Configure to drop specific events

I have a simply Splunk set-up.  about 120 or so Linux servers (that are all basically appliances) w/ universal forwarder installed, and a single Linux server running Splunk Enterprise acting as the ...
Egyas's user avatar
  • 165
0 votes
1 answer
51 views

Nginx not logging after Logrotate

I've a nginx reverse proxy with custom log files (depending on hostname) pwd : /var/log/nginx/domain/fqdn.(log|err) Since some time (maybe after switching to Ubuntu 23.10), my log files are very often ...
guillaumearnx's user avatar
0 votes
2 answers
103 views

Email all cron stdout+stderr output only on stderr

I would like cron to only email on stderr output but when it does it should include all stdout and stderr This is different than the usual question of only emailing on stderr (ie. redirect stdout to /...
Shovas's user avatar
  • 263
0 votes
0 answers
28 views

Cron job starts but doesn't wait to be completed [duplicate]

I've made a tool for backing up website files & DB. It works as expected if ran by any user. Usually it takes around a minute to run in my configuration. When I added it to the cron it starts but ...
Md. A. Apu's user avatar
0 votes
1 answer
66 views

Debian cron Job Not Working Correctly

I am running Debian 12, and trying to use crontab to execute a Python script to retrieve some files from an Artifactory repository periodically. I am running this job on a separate user account under ...
YTKme's user avatar
  • 3
1 vote
0 answers
41 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
0 votes
1 answer
31 views

Run QEMU command with cron

I have a machine that, aside of other services, needs to run a server VM. I'm running the VM with: qemu-system-x86_64 -nographic \ -enable-kvm \ -m 8G \ -smp 2 \ -hda gw_disk.qcow2 ...
PGalopa's user avatar
0 votes
3 answers
65 views

crontab -l not showing previous job

Earlier we scheduled a job in crontab and jobs are running fine. One of my teammates executed the crontab command; now previously scheduled jobs are not listing when you execute the crontab -l ...
RAM's user avatar
  • 1
0 votes
1 answer
70 views

get user with crontab root

I run myscript.sh scheduled in the root crontab and I need it to detect the non-root user (with which the system starts). I have tried these variants: local_user=${who -m | awk '{print $1;}'} ...
acgbox's user avatar
  • 398
0 votes
1 answer
48 views

command took very much longer to run from script than in CLI

In an AWS EC2 serverm, OS: amzn2-ami-kernel-5.10 x86_64 Trying to diagnose an issue of a slow running cron script, identified a single line of command that took more than an hour to run, everyday. ...
Jimmy Chi Kin Chau's user avatar
0 votes
1 answer
97 views

WP cli command not running in crontab

I've encountered and issue adding wp cli commands to my crontab. The following works: */1 * * * * sudo -u web0 -i /usr/local/bin/wp theme update --all --path=/var/www/domain.com/web > /home/bob/...
LinuxNovice's user avatar
1 vote
1 answer
208 views

Scheduling job on crontab with custom timing

Can anyone help me scheduling a job on crontab that will run on 12th of each month and if 12th falls on weekends it should run on the next Monday. I found something from Internet but it's not working ...
Kunal's user avatar
  • 11
0 votes
0 answers
93 views

On linux filesystem becoming RO, how to reliably reboot?

When the main Linux partition becomes ro for some reason (errors), I am trying to use cron job to check and reboot (so that fsck can run and attempt a fix), but I see that even the cron may not run! ...
Ani's user avatar
  • 32
0 votes
0 answers
302 views

inside nginx custom docker image, cron service is running but not the jobs executing

Dockerfile of nginx container FROM nginx:latest # Remove sym links from nginx image RUN rm /var/log/nginx/access.log RUN rm /var/log/nginx/error.log RUN apt-get update && apt-get install -y ...
Rajsekar Reddy's user avatar
1 vote
3 answers
640 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 ...
Pablo Fernandez's user avatar
0 votes
0 answers
62 views

at jobs don't clear the queue even when completed?

I have some very simple python code that sets up a job queue, piping to the linux batch command: import subprocess for j in range(1,17): process = subprocess.Popen('/bin/sh', '-c', f'python test.py ...
MKF's user avatar
  • 101
0 votes
1 answer
47 views

changed crontab, jobs run at old AND new time now

I did a non-best practice on /etc/crontab and manually changed it to run a daily cron job at a specific time, initially for testing so I could make sure it fired off correctly. /etc/crontab looked ...
Jim W's user avatar
  • 3
0 votes
1 answer
81 views

btrbk not taking hourly snapshots

I have installed btrbk and I would like hourly snapshots to be taken. However, only daily snapshots are done. I wonder what goes wrong. Pleas help me out. Environment: OS: Ubuntu 23.04 64bit / Linux 6....
crackpot's user avatar
  • 101
0 votes
2 answers
149 views

Why doesn't cron run the commands in another user's crontab?

Hello everyone and thank you in advance. I have written a job in the mysql user crontab, but it doesn't run at all. I think my code is correct, because it works properly if I execute it pointing to a ...
Centaro's user avatar
  • 19
0 votes
1 answer
775 views

Ubuntu 22.04 Jammy - cron seems to be ignoring timezone

I have a server configured to use the Pacific/Auckland timezone, however cron is running in UTC. In the previous OS version this was sufficient to get everything to operate using a specified timezone (...
Az Ilari's user avatar
1 vote
0 answers
80 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
0 votes
0 answers
255 views

k8s cron job using helm chart and docker

Two Helm chart for managing db cron jobs and monitoring cron jobs separately . Which k8s components can i use ? as k8s deprecated CronJob kind from v1.25, https://kubernetes.io/docs/reference/using-...
Sakshi Jain's user avatar
0 votes
0 answers
114 views

Laravel Crons on Elastic Beanstalk Linux AMI 2

I am running a Laravel app on Elastic Beanstalk Linux AMI 2. I am using the following config file in the .ebextensions folder to set up the cron. files: "/etc/cron.d/schedule_run": mode: &...
ackerchez's user avatar
  • 119
0 votes
1 answer
118 views

Delaying full crontab execution per user

In a large scale multi tenant environment where user's make heavy use of minutely crons, many crons setup by users will run on the minute or on the hour causing noticeable CPU spikes at the start of ...
epea's user avatar
  • 406
0 votes
2 answers
100 views

crontab shell script execution not as expected

I have a script named run_logs.sh with the contents: #!/bin/bash source /root/.profile zcat /var/log/apache2/access.log.*.gz | /usr/bin/goaccess - access.log when I run that script as root (both with ...
kevincw01's user avatar
0 votes
0 answers
35 views

Add Trigger Events to a Schedule Queue in Linux

I have a MySQL table on a Ubuntu or CentOS machine which contains rows on when to start and stop a bunch of 1000 AWS / Azure servers. Right now its implemented in such a way that a cron is running ...
anjanesh's user avatar
  • 337
0 votes
0 answers
110 views

solaris 10 cron job won't run but will run fine from command line

#!/bin/sh #grab oldest file from queue stuff=\`ls -1 /var/spool/lp/requests/localhost/ | /usr/bin/head -1\` #pull printer name from lp requests (first line in file) puff=\`cat $stuff | /usr/bin/...
Eve Bum's user avatar
0 votes
0 answers
88 views

Cron job is wokring fine but new cron logs are not adding in cron log file

i mistakely press wq! in cron log file located /var/log/cron now new logs are not updateing in cron log file i serach many thing like remove cron file and touch /var/log/cron Steel not updateing ...
Nipun Agarwal's user avatar
1 vote
1 answer
419 views

/etc/cron.d not running job [duplicate]

I need to run a script as a user to backup my database every night. I added the following cron job in /etc/cron.d/backup-mysql via ansible. 0 3 * * * backup_mysql /path/backup-mysql.sh I can see the ...
Ror's user avatar
  • 323
0 votes
2 answers
5k views

How to run a python script in a specific directory automatically?

I have a python script that I wish to run at 5pm every Friday. How can I achieve that ? I understand I could do this through cron. However, as I have used relative file paths in the Python script and ...
LT_Orange's user avatar
0 votes
0 answers
29 views

Dillon's dcron SYNC and ASYNC

The specific question for cron using Dillon's minimalist cron version is: How to create a cron job that runs every first Friday of the month, in ASYNC mode? Dillon's cron attempts to mix synchronous ...
DrBeco's user avatar
  • 109
0 votes
1 answer
730 views

crontab job output not generating email

I have been running many cron jobs (on various operating systems, CentOS, for example) that normally run with no output. I usually keep an eye on my jobs by checking my email. I use the fact that ...
EK0's user avatar
  • 235
1 vote
1 answer
74 views

Cron executes while partly ignoring trigger

There's a problem with my crontab I set */5 * * * * /home/money/relaunch.sh in crontab -e in relaunch.sh is #!/bin/bash /usr/bin/pgrep -l -x xyz || /home/money/a.sh && /home/money/xyz.sh ...
God of Money's user avatar
1 vote
1 answer
131 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
1 answer
401 views

Redirecting stdout and stderr doesn't work with cron

I have the following cron task. Expected behavior is that every output (standard output and standard error output) of this task will be redirected to /dev/null. Unfortunately this doesn't work. Emails ...
XorOrNor's user avatar
  • 241
0 votes
0 answers
51 views

Change default cron log location

I have apache server with $HOME is var/www/, I create a cron job and all logs get into that directory, how to change it to another folder? Is there any config file on apache to change that? Btw, I'm ...
Cross Vander's user avatar
0 votes
0 answers
104 views

why almalinux is hanging over night with auditlog

hey there is a hosting server overnight my server hanged up and must to restart it in morning to get it back online and saw this error in my console (you can see the picture) please help me https://...
ali rahmani's user avatar
0 votes
0 answers
760 views

logrotate works manually but not works automatically via cron on Ubuntu 18.04

I have a logrotate task to rotate my nginx logs. I have my config file in /etc/logrotate.d/nginx. When I run logrotate -f /etc/logrotate.d/nginx, it can rotate the logs correctly, which means my ...
Hank Chow's user avatar
  • 111
0 votes
1 answer
127 views

Error when I execute crontab in linux

I'm executing a crontab where it call the script of python and the crontab are executing very well, but when I execute the crontab I need its will create other file in another directory, but that ...
CristianDAG's user avatar
0 votes
0 answers
406 views

cron / crontab : auto delete oldest backup files when new files get backed up, only if disk space is near capacity

I am using crontab (on Ubuntu Server 20.04) to automatically create daily backups of a text file and storing them on an external hard drive. I am using the following crontab to create my backups: @...
DanRan's user avatar
  • 123
0 votes
1 answer
120 views

crontab job did not start on CentOS7 [duplicate]

here is the crontab for root on my CentOS7 : # crontab -l # Lines below here are managed by Salt, do not edit # SALT_CRON_IDENTIFIER:CLEANCORE 0 * * * * /var/lib/scality/cleancore/clean_core.bash --...
SebMa's user avatar
  • 379
0 votes
0 answers
45 views

Crontab I have tried cronitor airplane nothing helps

my crontabs do not run, sys log gives me this, Jan 6 08:30:02 joe-sbc-flt1 CRON[102851]: (joe) CMD (/home/joe/scripts/watchit.sh) I have no idea what it means or what is wrong, can anyone help?
extra views's user avatar
0 votes
1 answer
462 views

Cron Jobs don't run all the time (just a part of the hour)

I work on a website who is using cron jobs for import and update products. The platform is Woocommerce. The supplier offered the csv file, and a server requirements. I have them over the requested: ...
Alin Horne's user avatar
2 votes
1 answer
846 views

What is the best directory to place your cron jobs?

We have a machine that executes cron jobs. We'd like to upload (via scp) cron job files to. Here is an example of a cron job file (test.cron): * * * * * echo "test" > /tmp/test_cron This ...
Titi's user avatar
  • 23
0 votes
1 answer
949 views

Cronjob "No space left on device" when logging error but there is space [duplicate]

I am trying to troubleshoot some cronjob problems I am having so I wanted to start logging them. * * * * * wget https://www.example.com/dosomething.php >> /var/log/myjob.log 2>&1 When I ...
Cesar Bielich's user avatar
0 votes
1 answer
130 views

is my crontab syntax invalid?

simple question: 10 4 * * * rm -rf ~/code/rehlds/build/ && ~/code/rehlds/build.sh --compiler=gcc --jobs=4 > /dev/null 2>&1 I checked an there is no /build folder which indicates ...
eetzt's user avatar
  • 1
0 votes
2 answers
293 views

How to make timeout(1) behave in cron like it behaves in interactive shell

Running this command in an interactive bash: $ timeout 1 sleep 2; echo $? 124 returns 124 after 1 second, as expected and as documented in timeout(1). However, if I run the same as a cron job, or if ...
Sebastian Stark's user avatar
-1 votes
2 answers
170 views

mailx Set Name of Attached File

I have a cron job, whose output I send to mailx: # Monday morning at midnight; "mail" is symlink to "mailx" 00 00 * * mon python3 script-with-7500line-output.py | mailx -S 'from=...
Weylin Piegorsch's user avatar
0 votes
3 answers
241 views

Crontab not working as expected [duplicate]

Dears, i configured script in crontab to run every 10 minutes and its not working at all. I dont see any entry in configured log path (/var/log/cron) "*/10 * * * * example_script.sh" ...
Sudoo's user avatar
  • 11

1
2 3 4 5
40