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
1answer
20 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 ...
0
votes
2answers
63 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 ...
0
votes
0answers
20 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....
5
votes
1answer
299 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))' ...
0
votes
1answer
35 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 ...
0
votes
0answers
11 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 ...
0
votes
0answers
10 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/...
0
votes
1answer
25 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-$(...
1
vote
1answer
24 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 ...
2
votes
1answer
46 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>&...
0
votes
2answers
33 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 ...
1
vote
1answer
125 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: ...
1
vote
0answers
42 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 ...
0
votes
1answer
69 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": "...
0
votes
1answer
27 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 ...
0
votes
0answers
9 views

i get email notifiy from rkhunter : ": No such file or directory"

I running ubuntu headless server 18.04 LTS and have set up mail notification for the rkhunter application and I get this message every day: Email-Subject: Cron <root@example.com> test -x /usr/...
0
votes
1answer
71 views

Cron: MAILTO for all cronjob notifications to an external address uses the wrong `to` header

My goal is to send everything that gets output from the cron daemon (no matter which crontab) to an external email address with the correct TO email header. I set MAILTO in /etc/default/cron to MAILTO=...
1
vote
1answer
36 views

Uniform Server cron not executing php script

I'm running Uniform Server Zero XIV and am trying to use the cron to run a php script every 15 minutes. When ran manually, the script does what it is supposed to, which is updating values in a ...
0
votes
1answer
46 views

Dump an external database in Kubernetes

I have created a Kubernetes CronJob (in AKS) to run a database dump (the database is not located inside the Kubernetes cluster). This CronJob create a Job each day which will dump the database in a ...
1
vote
0answers
36 views

Cron Help in Amazon Linux 2 EC2 [duplicate]

It's like not only Amazon Linux 2 I could not setup cron. I type crontab -e then @reboot bash /home/ec2-user/abcd.sh After Rebooting the EC2, this cron job doesn't work. The same used to work in my ...
2
votes
1answer
58 views

How do I properly use flock(2) with a cron script?

I am using a crontab to execute a php script that retrieves data and writes it to a database. My crontab entry looks like: * * * * * php /path/to/file/fileName1.php * * * * * php /path/to/file/...
1
vote
2answers
269 views

Cron Job to move files not running

I added this command in my crontab, but it's not working. I saved in both my user and root crontab but neither is working. * * * * * [ $(ls -al /media/cyper/evo_1tb | grep plot | wc -l) -gt 0 ] &&...
0
votes
1answer
131 views

Why are cron jobs not being logged by rsyslog on Debian 10 buster?

(I figured this out, it was multiple problems...I'm leaving this as is and explain the process I took to resolve in my answer to this question) I'm working on a simple Ruby script that runs as a cron ...
1
vote
1answer
26 views

Bash-Skript (Cronjob): Programm öffnen hat falsche Sprache

Which ENV must be exported that a bash cronjob script opens the program in the correct language? If I open the bash script so manually in the command-line the program is opened in the correct language....
1
vote
2answers
33 views

Bash-script: run another script on bottom as an other user

I have a bash script that runs over crontab as root. On the bottom of that script I want to run another bash script as another user in a subshell (detached). How can I do that The normal command would ...
0
votes
0answers
45 views

crond not loading /etc/pam.d/crond config

I have this PAM config in /etc/pam.d/crond: auth required pam_env.so user_readenv=1 And this .pam_environment file: _APP_PASSWORD DEFAULT=foo And this test cronjob: */1 * * * * root env 2&>1 |...
0
votes
1answer
19 views

Prevent failed / interrupted cronjob from retrying

I have a cronjob (on a CentOS server) which looks like this: 20 3 * * * wget -qO- "http://example.com/mycronfile.php?parama=1&paramb=2&paramc=3" > /dev/null 2>&1 The PHP ...
0
votes
0answers
21 views

Alock is not launched when specified in crontab

I have the following problem: I am going to run a TV dashboard basing on Ubuntu 20.04 LTS focal with transparent screensaver and with locking feature enabled. In my configuration, I used activated ...
0
votes
1answer
72 views

Cron job to create and send backups over FTP

My VPS is running on Centos 7 with nginx and MySQL 8.0 I have created 2 cron jobs to backup my files and database everyday at a specific time. everything works fine but I'm trying to send those backup ...
0
votes
1answer
42 views

While a process is running manually, it stops after a while in the cron job [duplicate]

I have a PHP script and this script loops thousands of lines. When I run the PHP file manually, this loop of thousands of lines returns successfully. But when a cron job does this, it turns around 143 ...
0
votes
0answers
75 views

Cronjob execution based on different timezone (Ubuntu 18.04)

OS: Ubuntu 18.04 Cron: cron/bionic,now 3.0pl1-128.1ubuntu1 amd64 System timezone is: America/Los_Angeles (PST) I want to set timezone of an EXECUTION TIME (not the timezone for the script) for ...
0
votes
2answers
394 views

cron is not restarting pm2 [duplicate]

I've tried many things but cron just won't restart pm2. I set the crontab -e with: SHELL=/bin/sh PATH=/bin:/sbin:/usr/bin:/usr/sbin */10 * * * * /usr/bin/node /usr/bin/pm2 restart all And the I ...
0
votes
1answer
25 views

Do anacron jobs accumulate?

Let's say you set a script to run every week using anacron job, then you keep the machine turned off for "N" weeks. My question is: will the script run "N" times when you turn it ...
0
votes
1answer
14 views

Cron to find multiple file types and automatically delete them

I am trying to put together a command that will find multiple file types and automatically delete them. I want to run this in a cron every 10 minutes on my server. I would like to find files of type: ....
0
votes
0answers
49 views

Start MySql if it's not active

I have some problem, don't know why every day about 06:08-06:24 my mysql just stops: 2021-03-29T06:24:22.398643Z 0 [Note] Giving 0 client threads a chance to die gracefully 2021-03-29T06:24:22.398662Z ...
0
votes
2answers
19 views

Running newusers util in cron to batch create users does not run [duplicate]

I'm attempting to batch create some users from a file using the newusers util on ubuntu 18. When running in cron as the root user, nothing happens. When I run the command manually, it works as ...
1
vote
1answer
66 views

CRONTAB - Summer/Winder Time-Change

Since there can be problems with the time change from summer/winter or winter/summer, I wanted to ask how I could solve the problem within the bash script-2? I think in the winter time it should not ...
0
votes
1answer
639 views

Systemd timer OnCalendar every minute ending with 5

With OnCalendar systemd timer i can create something like this to run every 5 minutes. OnCalendar=*:0/5 Is it possible to run it at every minute ending at 5 (00:05, 00:15, 00:25...) only? And/or at ...
-2
votes
1answer
88 views

Sending Mail with Crontab [duplicate]

I have problem with sending mail in Crontab #!/bin/sh log_direc="/var/log/snort/alert" email="vodeni1953@heroulo.com" echo "TESST" | sendmail $email < output.txt` It ...
0
votes
1answer
20 views

What is a good way to keep multiple directories' contents synced with releases from a GitHub repo?

I work for a company that maintains lots of custom WordPress plugins and themes for our network of myriad WordPress sites. The repo managers have it set up so that webhooks are added to the repos and ...
0
votes
1answer
53 views

A (cron) job to run if file has changed

I need to backup a live sqlite db by running a command once a day. Only if the db file has changed since last backup. How could it be achieved on Centos 8 ?
0
votes
0answers
30 views

How do I color/format logs and also rotate without one action getting in the way of each other?

I have the following: A shell script which gets executed via screen and a screenlog gets generated using the flag -L. This shell script is just ncat (better version of netcat) listening on a specific ...
0
votes
0answers
15 views

How to run a bash script from cron without being a root? [duplicate]

I'm using redhat 7. My user is not a root user, and the root user can't run the commands in the bash script file. I added the command that runs the script in crontab -e but it doesn't run. However if ...
1
vote
0answers
43 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 ...
0
votes
0answers
72 views

How to determine which resource is exhausted

On a server with a very high load many of my daily cron jobs stopped working. I have postfix server running that only delivers locally so that I can see the output of the cron jobs with mutt. I ...
0
votes
0answers
373 views

Copy files from city web cam to WordPress site

Have a user that would like to copy city webcam images showing day by day construction of their building, then house those copied images on their WordPress site. The URL is always the same http://www....
0
votes
0answers
19 views

Using cron to automate backing up server with rsync doesn't work [duplicate]

I have a linux server hosting Minecraft that I can connect to using ssh, I should probably also mention that I do have an ssh key with no passphrase. I want to backup my Minecraft world every hour to ...
0
votes
1answer
47 views

Is there a way to handle host restart for CRON task if the restart frequency is extremely low about once-twice per year?

As mentioned in another question here: Job scheduling using crontab, what will happen when computer is shutdown during that time? that Cron jobs will not work during shutdown/restart case and we can ...
1
vote
1answer
100 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 ...
0
votes
0answers
94 views

Cron running Cerbot every minute

I have a peculiar problem. For some reason as the clock struck midnight on February 1st, cron is now running certbot every minute trying to renew a certificate. When running sudo crontab -l I get the ...

1
2 3 4 5
38