2022 Developer Survey is open! Take survey.

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
1 answer
25 views

shutdown and systemd service

At 5am cron runs shutdown, systemd executed /home/myuser/bin/mailme-shutdown.sh and my pc poweroff. When I startup the pc an email coming to me. The email is the script (mailme-shutodown.sh) executed ...
user avatar
  • 1,025
0 votes
1 answer
49 views

Aggregate multiple log files in a directory

I have k3s single node cluster running on a machine. I do not have any logging infrastructure set up yet and I'd leave this as a future learning experience for now. On that k3s I run some cron jobs ...
user avatar
  • 146
0 votes
1 answer
43 views

Why this java processes are not ending once cronjob has executed in the AIX server?

I have set a crontab for execute a java service in every 8 hours in AIX(7.1) operating system. Once the crontab has done the job, the JAVA service should be end. This cronjob is working properly. But ...
user avatar
0 votes
1 answer
70 views

How to troubleshoot Ubuntu Certbot cron/timer?

lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.2 LTS Release: 20.04 Codename: focal and have installed certbot via apt-get My issue is ...
user avatar
0 votes
0 answers
18 views

The timed task schedule on Debian 8 does not work [duplicate]

On Debian 8, I have files generated when I run this command: docker exec mysql-gerrit sh -c 'exec mysqldump --databases reviewdb \ -ugerrit -p"@#$456"' > /root/db_backup/`date +%Y%m%d`...
user avatar
  • 103
0 votes
0 answers
17 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 ...
user avatar
0 votes
1 answer
67 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 ...
user avatar
0 votes
1 answer
74 views

Run daily backup on Google Cloud Platform

I have a system running on Google Cloud. The system has one DB VM and instance group that runs backend server VMs. All VMs use the cos-stable VM image, and run a single docker container that contains ...
user avatar
  • 665
0 votes
0 answers
19 views

Why is my cronjob command interrupt after 1 minute? [duplicate]

I have a cronjob command that runs once every day on Ubuntu 18.04. Below is the crontab: 25 06 * * * /opt/my/app arg >> /opt/my/cron.log 2>&1 I checked the log and the command was run at ...
user avatar
0 votes
1 answer
70 views

Why does Cron Daemon send sendmail test messages on Ubuntu?

Since this morning I am receiving every 20 minutes a message from my Ubuntu Server that look like this: Subject: Cron <smmsp@fx> test -x /etc/init.d/sendmail && test -x /usr/share/...
user avatar
  • 1,983
0 votes
0 answers
15 views

GKE collector metrics missed some metrics

[enter image description here][1]On the cluster in GKE, we have a CronJob deployed, which sends prometheus metrics to the handler. A collector is launched to it using PodMonitor. I understand that it ...
user avatar
0 votes
0 answers
116 views

How to Save and Force Update of Dynamic DNS on pfSense?

Everytime the IP address of my pfSense changes i have to log-in to the panel, then go to Services > Dynamic DNS > Actions [Edit] > ♻ Save & Force Update Please, how do i do this using ...
user avatar
0 votes
1 answer
63 views

Using quotes in variables of a crontab job

I'm trying to get a past date inside a cron job using something like this. But the DATE variable is always empty. DATE=date -d "$date -1 days -1 months" +%Y-%m * * * * * /bin/echo "Date:...
user avatar
1 vote
1 answer
243 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!" >&...
user avatar
0 votes
0 answers
16 views

zipping in crontab does not work [duplicate]

Im trying to zip my savegames (an push them to dropbox). However, even though zipping works fine it does not seem to work when I past the command into contab. * * * * * cd /home/steam/.config/Epic/...
user avatar
  • 1
-1 votes
1 answer
45 views

WP-CLI doesnt run from cronjob [duplicate]

I have a bash script which is retrieving the information from my database, based on the information it gets creates some folders containing the WP files on each one and then makes the setting. The ...
user avatar
  • 1
1 vote
1 answer
40 views

When I execute a script in crontab the output is in a different language

I am executing a script in a crontab that writes a log, when I run it as root, the log is written in spanish. But when I run it in the crontab, the output is in english. Is there a way to run the ...
user avatar
0 votes
0 answers
120 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 &...
user avatar
0 votes
1 answer
157 views

cron/php how to run command as a non root user

I need to run command (only one command) as a non root user from cron. Have tried two versions and both fails; Cron: * * * * * php script.php script.php: exec("whoami"); // returns 'root' //...
user avatar
  • 107
2 votes
2 answers
612 views

How can I crontably reboot a Linux host upon network failure? [closed]

I have a personal Ubuntu host, connected to a public/sharing Wi-Fi AP (not under my control). Sometimes, it would have a network issue, and I am very sure, only restarting the network service would ...
user avatar
1 vote
1 answer
33 views

Cron job does not start at hh:10

*/10 * * * * This should run the job (PHP script) every 10 minutes, but it does not ran at hh:10... The PHP script writing data to a MySQL database which should be done every 10 minutes e.g. 2021-12-...
user avatar
  • 111
1 vote
1 answer
44 views

How can I make my cronjob friendly to reboot and other interruptions?

I have as part of my cronjob a variable random delay. This has good reasons to exist, it's to distribute the load of the automated process from spiking on various minute or hour boundaries. I suspect (...
user avatar
  • 228
0 votes
1 answer
46 views

How Do I Get Crontab to Run a Whole Directory of PHP Files?

I've created a little program that will generate php files and place them into a '/crons' folder to allow cron jobs to execute the files. These php files will be generated and named dynamically based ...
user avatar
0 votes
0 answers
29 views

How do you debug a cronjob that's not working?

ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); $_SERVER['SERVER_SOFTWARE'] = 'Apache'; $_SERVER['HTTP_USER_AGENT'] = 'PHP'; $_SERVER['PHP_SELF'] = '/wp/wp-...
user avatar
  • 13
0 votes
4 answers
431 views

Start cron job from 06:05 until 22:05 for every 15 minutes

I need to run a cron job every 15 minutes starting at 06:05 and ending at 22:05. 0 5/15 6-22 * * * The following syntax includes 22:35 and 22:50. Any idea how to achieve this? Is this possible with ...
user avatar
  • 223
0 votes
2 answers
57 views

How to disable crontab list entries in cron log?

I have a script on server that runs every few min, and among other things checks if some malicious crontab entries have been injected. In order to do this I check crontabs of all users, which works ...
user avatar
  • 23
0 votes
1 answer
97 views

How to use a screen with bash script? [duplicate]

I tried to create an executable .sh file with command that create screen like this: screen -dmS ast [comand] And let my crontab execute it like this * * * * * bash /root/my_bash.sh But nothing ...
user avatar
0 votes
1 answer
150 views

Crontab - day of month seems to override day of week?

I have five servers running an eventstore cluster. I want to run a crontab command on each one on separate days. Run on Monday Run on Tuesday etc But I also want to run a different command on the ...
user avatar
0 votes
1 answer
126 views

CRON[83463]: Failure setting user credentials

I have a number of docker containers, all set up mostly identically, which successfully use cron to run nightly backup jobs. I have another container, set up mostly identically, which tries, and fails,...
user avatar
  • 328
0 votes
3 answers
510 views

How to run Python venv script with screen in crontab

I have a sh script with the following content: screen -mdS myscript /home/myscript/myscript_env/bin/python3 /home/myscript/bot.py This script executes a python script and opens it in a new screen. It ...
user avatar
0 votes
1 answer
267 views

script backups sqlite database, when ran as a cron the db and names are mangled

I have a crontab: * * * * * /home/ipa/web/backup.sh > /dev/null 2>&1 (No it doesn't run every minute just testing here) The backup.sh has this: #!/usr/bin/env sh sqlite3 /home/ipa/web/...
user avatar
  • 67
0 votes
1 answer
110 views

Cronjob Files Not Closing and 100% CPU usage

I'm running a php file every 10 seconds with a cronjob. While the system was running fine, I noticed last night that php was using 100% of the CPU and crashing the system. When I checked with ps aux, ...
user avatar
0 votes
0 answers
93 views

ansible-playbook: command not found when running bash with cron [duplicate]

Running on ubuntu18, have a bash job to collect data from a router using ansible. Here is the bash script #!/bin/bash cd ~/datacollect ansible-playbook -i /home/user/datacollect/hosts /home/user/...
user avatar
0 votes
1 answer
59 views

Issue with WP Cron does not appear to be working correctly - Wordpress

The wordpress site has been showing the message "Problem with WP Cron does not appear to be working correctly". We have tried a lot of things, but nothing. This problem appeared from nowhere....
user avatar
0 votes
1 answer
74 views

EC2 server with a crond-service and full /var/spool/exim/-folder

I'm no expert in linux, apache, etc. but I have this service running on an AWS EC2-server. There is a large number of cron-jobs running on my platform (about 50K / day). Last week upgraded the EC2-...
user avatar
0 votes
1 answer
38 views

Send keys over ssh connection to nano editor

I have a situation where I am deleting the crontab and then recreate it. So I do crontab -r and then crontab -e. The problem I have is that crontab -e opens up nano, and I'd like a command line that ...
user avatar
  • 1
0 votes
2 answers
422 views

No such file or directory in sh file running

It may be duplicate because there is some similar question but I am not able to fix it, that's why I ask again with my code. My sh have these code: cd /home/domain.com/data/domain-statistics git fetch ...
user avatar
0 votes
0 answers
53 views

/etc/cron.daily/ what this command is doing?

Could you help to explain what this command is doing? printf '#!/bin/sh\n\find /opt/traccar/logs -mtime +5 -type f -delete\n' > /etc/cron.daily/traccar-clear-logs && chmod +x /etc/cron....
user avatar
4 votes
1 answer
691 views

Will certbot actually renew my certificate?

Looking at /etc/cron.d/certbot, I don't think it will! That file includes the line: 0 */12 * * * root test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e 'sleep int(rand(43200))' ...
user avatar
  • 143
0 votes
1 answer
97 views

crontab: using ${USER}

I am writing some scripts that uses ${USER} to point to subsequent scripts. But when I run it from crontab, it errors out and the files are not found. I understand why. I intend to share this with my ...
user avatar
  • 101
0 votes
0 answers
14 views

I am getting anacron error alert "0 processes running with arguments: "/usr/sbin/anacron -s"

I am getting an alert from a linux server and alert is "0 processes running with arguments: "/usr/sbin/anacron -s", with command: "anacron", as regex" . What could be the ...
user avatar
0 votes
0 answers
23 views

How does systemd ensure to run cron.daily for desktops/laptops that occasionally are powered off?

How does systemd ensure to run cron.daily for desktops/laptops that occasionally are powered off? In the past I relied on anacron, it took care of my /etc/crod.daily. UPDATE I see https://github.com/...
user avatar
  • 662
0 votes
1 answer
248 views

visudo says that there is a syntax error

I am using centos 8.So, my intent is to make the user manager to be able to run this command without the need to use sudo. manager ALL=NOPASSWD: tar -czf /root/assignment/result/student-submissions-$(...
user avatar
1 vote
1 answer
36 views

Crontab - How to verify a PHP script Runs Successfully or not in a Cronjob Shell Script?

I have below crontab in the system (Centos 7.9), However i am unable to verify if this runs correctly or not, i.e if the crontab finds the PHP enr. variables or if the crontab has executed correctly ...
user avatar
  • 3,845
2 votes
1 answer
2k views

What is the meaning of the "/dev/null 2>&1" in a Cronjob entry?

Can someone explain to me what is the meaning of "2>&1" doing here in the below cron job 0 23 * * * wget -q -O /dev/null "https://example.com/index.php" > /dev/null 2>&...
user avatar
  • 3,845
0 votes
2 answers
116 views

Cron Tab as specific user and python virtual env

Wanting to run an hourly cron job as a specific user (xfeautomation) and python virtual environment. Running as a specific user, will I have to add the script location into PATH? My current cron job ...
user avatar
1 vote
1 answer
469 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: ...
user avatar
0 votes
0 answers
162 views

`vbetool dpms off` not working from crontab

I have an old laptop I'm using to host a home Debian server. I'd like to switch the screen off at boot, so I put @reboot vbetool dpms off in the root crontab (sudo crontab -e). It looks like it runs ...
user avatar
  • 101
0 votes
1 answer
150 views

Google Jobs: Quota exceeded for the number of App Engine Cron jobs

Yesterday at 8:00 am, I had a quota of 250 app-engine jobs. At 9:00 am, I deployed a yaml file with 280 jobs, I got this error: "error": { "code": 429, "message": "...
user avatar
  • 1
0 votes
1 answer
166 views

Can't get cron to open Jar file

I'm running a minecraft server on ubuntu 20.04. I have a script to execute it and works fine. However i can't get it to work @reboot with cron, because it can't find the jar file. From what i ...
user avatar

1
2 3 4 5
38