Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [cron]

Cron is a job scheduler that allows users to run commands periodically.

0
votes
1answer
35 views

How to check the version of cron that is running?

how can I check which version of Cron is currently installed and running on my host? I can't seem to find a command that will allow to me see which version is running. They all seem to just show ...
0
votes
2answers
29 views

SMTP Email not sent using cronjob - AIX [closed]

I have a bash script that sends email via SMTP server. It works perfectly and sends email when I execute it manually, but when it is executed using a cronjob it does not send the email. I am using AIX ...
1
vote
2answers
29 views

How to cancel anacron jobs delayed for a certain length of time?

Background: I want to backup some files on my laptop on a daily basis, and there are times when the laptop is shut down for several days in a row. I tried scheduling the backup as a cron job and ...
0
votes
1answer
49 views

Why would it not be a good idea to schedule a shutdown with cron?

In an answer to the question How to shutdown Linux at a specific datetime from terminal? a high-rep user provides two solutions: using at and using cron. The cron-based option says "this not a good ...
4
votes
2answers
329 views

Cron is trying (and failing) to open env file: /etc/environment

I'm using Devuan ASCII (which is more or less Debian 9, Stretch). Now, my /var/log/auth.log has a bunch of these entries: Jan 6 09:45:01 mybox CRON[20951]: pam_env(cron:session): Unable to open env ...
1
vote
1answer
24 views

crond won't start. Problem with temp directory /run/cron?

A week ago I updated my wife's computer, and after a few days noticed that crond wasn't running. Running crond -d wasn't much useful, so I ran strace crond -d`. This error appears: openat(AT_FDCWD, "/...
1
vote
1answer
30 views

Cronjob not executing, but command works

I have a server (Ubuntu 18.04) that is supposed to execute a Django management command at a certain interval. (every day at 16:30) I have setup jobs like this before, using cron but for some reason ...
0
votes
1answer
27 views

How to monitor cron maintenance scripts?

My home server runs a couple of shell scripts regularly for maintenance tasks - mostly backup, but also other stuff. I would like to be alerted in case anything fails but also keep a log of when it ...
0
votes
1answer
30 views

execute sh script from crontab problem

I was configuring crontab with user "pi" to execute an sh script every 30 mins. In terminal:crontab -u pi -eI added this line: */30 * * * * /bin/sh /home/pi/test.sh And in the script test.sh there ...
0
votes
0answers
34 views

Incorrect timestamps in cron logs on CentOS 7 VM?

I need to see accurate timestamps for the cron logs of a CentOS 7 VM using an OpenVZ-based image. The machine also has SCL enabled because Red Hat supplies antique software out-of-the box. Users like ...
1
vote
3answers
63 views

How to debug cronjob is not trigger in Linux Ubuntu?

I'm in Ubuntu linux. I just added this cron-job to run every minutes MAILTO="email@gmail.com" ...
0
votes
1answer
30 views

How to attach to an active session with a specific window and run a cronjob?

On my development setup I have an active session with multiple windows, I'd like to spit out the cronjob's output to this active session into a specific window . I wrote in the crontab the command: /...
0
votes
1answer
34 views

Cron jobs present in /etc/cron.* but no cron jobs for any user?

I'm trying to troubleshoot a cron failure on a CentOS 7 VM hosting a website and wiki. There's lot's of fodder on the web about troubleshooting cron, but I am having trouble understanding what I am ...
1
vote
1answer
86 views

What is logging in?

From https://unix.stackexchange.com/a/489913/674 Logging in is a user-space construct; the kernel doesn’t care about that. There are multiple examples of this; for example, cron jobs can run ...
0
votes
1answer
41 views

Bash script able to run manually, but with cron not working. + Ubuntu 16.04

Env:- Ubuntu 18.04 I write one C program and trying to speak to port and fetch some data and dump into one file. Then I created one bash script and added this C program and expect to run at multiple ...
0
votes
0answers
30 views

how to take affect the seting on temporary files ( /tmp )

subject - new settings retarding temporary files ( redhat 7.2 ) we set new values on the following configuration files , in order to minimize /tmp capacity in file: /lib/systemd/system/systemd-...
1
vote
1answer
55 views

how to manage cleaning of /tmp better on hadoop machines

As all know the content of /tmp should be deleted after some time. In my case we have machines ( redhat version 7.2 ) that are configured as following. As we can see the service that is triggered ...
4
votes
2answers
418 views

Linux + files & folders cleanup under /tmp

On all my Red Hat Linux machines version 7.2 we saw that systemd-tmpfiles-clean.service is inactive: systemctl status systemd-tmpfiles-clean.service ● systemd-tmpfiles-clean.service - Cleanup of ...
3
votes
1answer
76 views

find not working correctly in cron

We have a regular job on a server that creates some files in /tmp and doesn't delete them after it is done. For reasons I don't want to get into, we can't modify the job to delete the files. So I was ...
1
vote
1answer
26 views

Can't display the date correctly in a file generated by a cronjob [duplicate]

I'm doing a cronjob task which creates a daily database backup. To desctinct the daily files, I name them as follows: dump- (the current date). The backup operation went well, but the date is not ...
0
votes
2answers
60 views

Problem with crontab

My script which starts a process and writes the PID of that process to file. This works as it's supposed to when I execute it from shell: process & echo $! > /home/xxx/PIDs/process.pid But ...
0
votes
1answer
24 views

change a value in a file

I have a configuration file that some of its lines is like below: # Mandatory: no # Range: 0-5 # Default: DebugLevel=3 I want to change the 3 at DebugLevel to 5 at 2 AM then after for example 2 ...
0
votes
0answers
37 views

Cron: Paramiko script, private RSA key invalid when run with crontab

I have a small paramiko script that runs wonderfully from interactive shell. However when run as a cron job in /etc/crontab it fails with paramiko.ssh_exception.SSHException: not a valid RSA private ...
1
vote
2answers
80 views

How to make systemd timer run exactly every 10 minutes, with a task that lasts slightly longer than that?

I have a rather annoying issue with systemd timers and drifting start time. I had an old cron.d script (which executed faithfully once every 10 minutes) that I'm trying to modernize. The problem is ...
5
votes
1answer
82 views

Script in /etc/cron.hourly/ never running

I have a script in /etc/cron.hourly : -rwxr-xr-x 1 root root 85 Dec 6 19:05 /etc/cron.hourly/nvidia_to_exclusive containing (with an empty line at the end): #!/bin/bash /usr/bin/nvidia-smi -c 1 &...
-2
votes
1answer
29 views

Crontab changes not working

I recently made some changes to my crontab, added some new entries and activated one disabled (commented) entry. However, the new changes that I made were not triggered and the crontab functioned as ...
0
votes
2answers
41 views

Crontab error with php sendDiaryMail

I add the 30 22 * * * php /www/wwwroot/easy_xyz/xcat sendDiaryMail line in my crontab -e to like this: 30 22 * * * php /www/wwwroot/easy_xyz/xcat sendDiaryMail 55 0 * * * "/root/.acme.sh"/acme.sh -...
0
votes
0answers
11 views

How to pass automatic inputs to jar engine while running a wrapper shell script

I am working on wrapper script which will execute 10 script in a sequence in a given specific time by scheduling crontab for the wrapper script .Here i have a challenge we have a third party java ...
2
votes
1answer
82 views

Why I can't pass a parameter from cron to shell script [closed]

With this cron script I am trying to get Rsync to work */1 * * * * /root/backup.sh `date +today/\%M` And a shell script as the one below #!/bin/bash -x PATH=/bin:/usr/bin:/sbin:/usr/sbin REMOTE=...
0
votes
3answers
461 views

Crontab tasks aren't running

I tried created a very simple cron task that echo's "Hello World" into a file named /tmp/example.txt. You can see from the screenshot, I tried: 28 23 * * * echo "Hello World" >> /tmp/example....
0
votes
1answer
34 views

Use crontab to start AnyDesk

I am using AnyDesk on a Raspberry Pi 3. After around 6-7 days, it suddenly consumes all the memory and the device stops responding. To prevent this, I am using crontab to execute /usr/bin/killall ...
3
votes
0answers
63 views

rsync gets stuck on *.png files [closed]

I have been running the following rsync command as a cronjob for the past month. Today I discovered that this has been getting stuck on a *.png file and none of my other data has been backing up! In ...
0
votes
0answers
28 views

Reconstruct changes to the crontab and a directory over 5 Months

Is there any way to show who moved/deleted/restored files at a specific point in time on a linux server and who changed the crontab? Given the case described below, somebody or something either ...
0
votes
1answer
26 views

cron doesn't execute scripts after setting it up

According to this site I set up cron to execute a script for me, first just trying to get it to work with cat before doing the actual work I need to do (actual work will need root priviliges so I did ...
0
votes
1answer
55 views

htop and crontab

I have a crontab like this for root user: 9 17 * * * TERM=xterm /bin/bash /root/htop_stat.sh htop_stat.sh: /usr/bin/echo q | /usr/bin/htop -C | /usr/bin/aha --line-fix | /usr/bin/html2text -width ...
-1
votes
1answer
46 views

Install a package manually -Debian [closed]

I am working on a customized Linux Debian (Debian 4.9.2-10) server. I would like to install crontab, which is not installed in the system neither its letting me configure it using the apt or dpkg ...
-1
votes
2answers
53 views

cp command throwing error in crontab [duplicate]

I have the following command in my crontab to copy a file named 'data' into an existing directory named 'Archive', with a date stamp appended to it. When I run it on the command line manually, it ...
-1
votes
2answers
78 views

Is there any disadvantage of making software update and upgrade automatic? [closed]

On Lubuntu 18.04, Software Updater notifies me there is update available from time to time. If I happen to have the time to, I will manually run sudo apt update; sudo apt upgrade. I am thinking about ...
0
votes
0answers
31 views

How can I make cron log standard output to a file, but email me if there's an error

I thought this would do it: 0 5 * * * /home/backup.sh >> /home/backup.log (backup.sh contains "/root/gsutil/gsutil -m rsync -r /home/data/. gs://my-data") My understanding is that any ...
1
vote
1answer
47 views

Why not allow all users to schedule jobs with crontabs? [closed]

By setting /etc/cron.allow and/or /etc/cron.deny it's possible to restrict what user is allowed to use crontabs to schedule a cron job to run as that user. At least at my office our SAs default to ...
0
votes
0answers
20 views

Why can I not run KDE redshift in a cronjob? [duplicate]

I'm running KDE Neon 5.14 (based on Ubuntu 18.04) and KDE Plasma 5.14.2. A command redshift (/usr/bin/redshift) is provided to adapt the screen colors to red tones for evening/night. I can ...
2
votes
3answers
110 views

Why does cron use MTA to send emails, while we use MUA to send emails?

I have looked at the definitions of MTA, MUA, MDA, for example, https://ccm.net/contents/116-how-email-works-mta-mda-mua and https://en.wikipedia.org/wiki/Email_agent_(infrastructure) In Lubuntu, the ...
0
votes
1answer
89 views

Cron.d not running (rsnapshot)

Yesterday I've configured rsnapshot on a debian 9 machine, but the cron's I've set for the backups in /etc/cron.d/rsnapshot are not being executed. Also, after I save & close the /etc/cron.d/...
1
vote
1answer
141 views

Where does cron log by default?

On Ubuntu 18.04, man cron says cron logs its action to the syslog facility 'cron', and logging may be controlled using the standard syslogd(8) facility Also, the default configuration of ...
0
votes
1answer
153 views

How does cron set the environment variables in /etc/cron.d/* and /etc/cron.d/?

In Debian's manpage of cron, The files in /etc/cron.d/ are independent of /etc/crontab: they do not, for example, inherit environment variable settings from it. and from the LinuxQuestions.org ...
0
votes
1answer
46 views

why does the cron daemon make efforts about recording output when executing a cron job, instead of using redirection inside the job?

The manpage of cron says When executing commands, any output is mailed to the owner of the crontab (or to the user specified in the MAILTO environment variable in the crontab, if such ...
3
votes
2answers
199 views

What is `-p` used for `cron`?

In cron's manpage (cronie) -p Allows Cron to accept any user set crontables. I learned that cron daemon will implicitly search for and run the cron jobs defined in /etc/crontab, /etc/cron.d/* ...
0
votes
2answers
43 views

user specific jobs vs system jobs running as specific users

On Debian and its derivatives, how shall we understand the following seemingly contradictory facts: /etc/crontab and /etc/cron.d/* have a user field, meaning that a job is running as the user (either ...
0
votes
2answers
144 views

Can I manually create and edit `/var/spool/cron/crontabs/t` without `crontab -e`?

I heard that /etc/crontab and /etc/cron.d/* can only be edited manually without crontab command from How would you edit `/etc/crontab` and files under `/etc/cron.d/?. Do I need to run crontab -e to ...
0
votes
1answer
37 views

Does cron modify execution environment and make tor servce not change exit node?

According to https://unix.stackexchange.com/a/478636/674, cron modifies the execution environment to execute a job. When I run sudo service tor reload twice directly in bash, it always shows two ...