Stack Exchange Network

Stack Exchange network consists of 175 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.

5
votes
0answers
4k views

`crontab -e` sometimes fails with “Creation of temporary crontab file failed”

From time to time crontab -e fails on me on a Ubuntu box. It is the same for all users including the root and crontab -eu <user> under the root. Goes like this on a regular basis, a success here ...
3
votes
0answers
39 views

How to deny crontab to group

I'm trying to deny crontab to group but I had no success so far. Nor I saw how to do it, or even discussions about it. Is it possible to deny crontab to groups instead of users? Imagine if you have ...
3
votes
0answers
401 views

Use dedicated per-user log file for cron and?

On Ubuntu 12.04 how can I configure cron to log to a particular file when it runs jobs as a particular user? I am interested in redirecting both the messages that go into auth.log and those going into ...
3
votes
0answers
1k views

Cron file syntax checker/validator script

Does anyone know a script (bash, perl, php ...) to validate the syntax of crontab files? I found this http://www.intuitive.com/wicked/showscript.cgi?053-verifycron.sh but just Vixie cron notation is ...
2
votes
0answers
20 views

How to start at boot a service that lives within a user's schroot?

Due to legacy (aka corporate) reasons, I have a number of servers running recent Debian versions (Debian 9, Debian 10) that also need to run older services such as MySQL 5.5. This is done via a (pre-...
2
votes
0answers
2k views

Why is crond failing to run a non-root crontab on alpine linux?

I am having a nasty time running a non-root crontab file on Alpine Linux. I've been through two other cron related posts and I don't have an answer: https://askubuntu.com/questions/23009/why-crontab-...
2
votes
0answers
392 views

cron rsnapshot - weekly before monthly how to

I'm trying to run rsnapshot per the doc specs, to avoid race conditions. basically the docs say to run the largest interval before the smaller one, about a half hour apart, and so forth. (not using ...
2
votes
0answers
308 views

Run minutely cronjobs in parallel

I have a minutely cronjob running on Openshift. This cronjob executes an URL that usually takes 5 minutes to run (it's used to generate reports). I was expecting multiple instances of the cronjob to ...
2
votes
0answers
184 views

Running a process in a specified time window

Large computational tasks consume time and computational resources, therefore I am looking for a way to execute them in a specified time window using a shell script. I want to run the script batch.sh ...
2
votes
0answers
105 views

AppleScript dialog and repeated `say' command not working in OS X cronjob

I've got a script in OS X that looks in a given directory for the file with the most recent mtime, sees if it's (past) a certain size, and, if so, creates an AppleScript dialog box + repeats an ...
2
votes
0answers
1k views

linux audit repeating USER_ACCT CRED_ACQ LOGIN USER_START USER_END under cron

my system is Suse SLES 11.4 x86-64 and the following seems to be generated every minute. This is after a system reboot with much of everything turned off in chkconfig, including auditd. I start ...
2
votes
0answers
509 views

Running R script and global variable overriding with <<- from cron

I have a R script that works just fine when I run it from RStudio. However, once I schedule it through cron under user RStudio only with home directory (/home/rstudio), it halts at the very step I ...
2
votes
0answers
480 views

crontab job deleted my file in /tmp

I have used RHEL6/CentOS6 before and some application work good on my system. Now I have a new CentOS 7 installation,something confused me. I create a cron job with user myuser, like this: */4 * * *...
2
votes
0answers
121 views

Program/script to limit cronjob output

Short version: Is there an off-the-shelf program to avoid being pinged repeatedly be frequent cron jobs in periods when they fail? I have a custom implementation but it seems like something someone ...
2
votes
0answers
770 views

running cron on a chroot

For my web development I use a debootstrap'ped Debian with sysvinit, I start apache2/mysql manually only when I need to work. Now for a new project I require to run some scheduled task for which I ...
2
votes
0answers
326 views

Why a crond can start late randomly

I have this issue of a cron that executes a PHP script at minute 20 every hour, This script generates a small number of reports based on data from a MySql database. Generally this script ends ...
2
votes
0answers
520 views

How to overcome this error when running a script in crontab?

This is basically my script. #!/bin/sh #set -x PATH=/usr/jdk/instances/current/bin:/usr/bin:/bin:/opt/ss7/access/bin:/opt/ss7/sgc/bin:/opt/ss7/access/install:/opt/ss7/sgc/install:/usr/jdk/instances/...
2
votes
0answers
141 views

Strange cron behaviour

I have a script that reads a list of IPs from a file, compares with the existing ones in a chain, and adds recently added IPs in the file into that chain. Running the script manually (e.g., ./script) ...
2
votes
0answers
480 views

filter cron emails through procmail?

I'm using postfix/mutt/procmail on a Linux/Debian and I've some trouble filtering cron emails with procmail, I just want to move them to the cron/ maildir directory, but no lucky till now. I've ...
1
vote
0answers
26 views

Git add, commit, push from bash script

I'm trying to write a simple cron job that will keep my org-mode files in sync with a GitHub repo by committing every now and then. For some reason, it always manages to commit the files, but even ...
1
vote
0answers
26 views

Rsnapshot log entries: “Number of hard links > 1”

I just noticed that my syslog is being spammed by rsnapshot, writing <host name> cron[1100]: (*system*rsnapshot) NUMBER OF HARD LINKS > 1 (/etc/cron.d/rsnapshot) every minute or two. It ...
1
vote
0answers
11 views

How to implement a worker system using only Cron?

I have a PHP web application with a particularly slow endpoint and I have diagnosed that this is being caused by a complicated function call. It is not essential that the function call is completed ...
1
vote
0answers
903 views

CRON (no tty): Delete message with specific “Message-Id”

I have a situation where I need to delete from mailbox (eg. /var/mail/root) messages with specific Message-Id. Following code works only from console, but I have to do it without user interaction ...
1
vote
0answers
134 views

Why does this rsync command running in a cron fail?

Why does this rsync command running in a cron fail and how to debug it and fix? unset SSH_AUTH_SOCK && unset KRB5CCNAME && rsync -hvru -e "ssh -p 34503 -i /root/.ssh/...
1
vote
0answers
74 views

install job on crontab

I definitely sure that the syntax I am using in the crontab file is correct because I installed the same job on another host and it is working fine. The syntax is: 05 10 * * mon,wed,fri /app/aban/...
1
vote
0answers
477 views

Show all scheduled cron jobs

How can I list all cron jobs which are scheduled to run? I need to check if my cron jobs are working. I guess they don't even run, because our Magento does not send out any order confirmation emails ...
1
vote
0answers
163 views

systemctl doesn't work from crontab

I'm trying to run a script calling systemctl from crontab but the command is not being executed. Other scripts work fine from crontab. The script works when executed in a terminal. This is the script:...
1
vote
0answers
404 views

Debian : E: Command line option --allow-releaseinfo-change is not understood

Since several days i'm getting the following error on a Debian 8 system from cron: /etc/cron.daily/distupgrade: E: Command line option --allow-releaseinfo-change is not understood I never touched ...
1
vote
0answers
115 views

Odd Characters in Log File

I checked my cron log files today for a script that I have scheduled and the saw the following errors/characters: \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\ ...
1
vote
0answers
354 views

Odd behavior of cron on @reboot

On Debian 8 after adding @reboot-line to crontab there are some strange results. All actions are performed by root. crontab -l shows @reboot /root/startup.sh startup.sh (+x rights): #!/bin/bash ...
1
vote
0answers
82 views

Upstart script with expect scripting

Please give me advices about expect scripting combined with an upstart script. There are 3 scripts that I am dealing with right now. Script A) Java program PATH: /opt/~~/manager Script B) ...
1
vote
0answers
42 views

rsyslog cron.daily warning message

I am running Ubuntu 16.04 and cron is emailing me the following message /etc/cron.daily/logrotate: Warning: Stopping rsyslog.service, but it can still be activated by: syslog.socket I have not made ...
1
vote
0answers
2k views

Crontab in Mac is not working

I'm trying to automate a python job using crontab in mac. It's not running on the cron however it's working when run manually & have given full permission to the scripts. As a test, did a echo ...
1
vote
0answers
222 views

Cronjob upgrading gitlab-ce fails

I'm trying to "auto-update" gitlab. I created a shell-script that checks for updates, installs when an update is available and e-mails the results. This all works perfectly fine from a terminal when I ...
1
vote
0answers
713 views

Start wvdial on boot from crontab

I'm trying to get work crontab, I'm editing crontab with sudo crontab -e. After that I add the line @reboot wvdial at the end of file, theoretically, every boot the computer connect with wvdial ...
1
vote
0answers
229 views

How can I configure scheduled virtual machine backup?

I have a box with: Debian 8.3 Jessie in minimal config 16 Gb RAM 4-core Intel SandyBridge 2.5 Ghz 2 x 300 Gb SAS in RAID10 (using hardware controller) qemu-kvm and virt-manager are installed ...
1
vote
0answers
51 views

Cron Job Download Updates

I'm running CentOS7 and I would like to know how to set up a Bi-Weekly cronjob to download update packages for CentOS6 and CentOS7 (os,extras,updates) from the fastest mirror and place them in the ...
1
vote
0answers
708 views

mtr not working from cron

The script below works perfectly when ran from the CLI but when running it from a cron it fails with the error "/usr/local/sbin/mtr: Failure to start mtr-packet: Invalid argument" Here's the cron ...
1
vote
0answers
164 views

Screensaver in the Shell

I like the screensaver cmatrix. Is their a way to set up a crontab to check if the shell is inactive every 10 mins (using xprintidle) and then if that is true run the screensaver command cmatrix -abs?
1
vote
0answers
26 views

How to initiate process for a script via cronjob, monitor status, and log execution time

How to initiate process for a script that will run via cronjob, then monitor the status, and log start and stop run time. Any code snippet will be helpful... Thanks
1
vote
0answers
152 views

Sending a mail inside a scheduled (cron) shell script does not work

I have a shell script with the following content #!/bin/sh sudo Rscript /home/username/RWD/test.R sudo find /home/username/RWD -type f -name "*.png" -exec /usr/bin/mpack -s "Test Mail" {} my.email@...
1
vote
0answers
140 views

List directory contents redirect to file using tee

I'm having some difficulty understanding why a particular process is failing. Basically, I have a line in my script that is listing directory contents, using tee to redirect the output to two files: ...
1
vote
0answers
508 views

How to restart an app monitored by monit at specific time

I have long-running python app which is monitored by monit, checking if all is well each minute. This is great, however, if the app misbehaves, I want users to be able to kill it, and thus far that ...
1
vote
0answers
92 views

Cron running tasks at second 26?

I've many vps with the same cron task sending data with curl every minute, e.g. date command output. So I'm receiving datetime from every vps and I just realized that one of them is running the cron ...
1
vote
0answers
342 views

How to add cron jobs to my router ? I have SSH access

I have the router my ISP gave to me. I used SSH to get into my router (this is undocumented). I found the router is running some kind of linux. In the /bin/ directory I have: addgroup chmod df ...
1
vote
0answers
94 views

Master environment script based on $LOGNAME to run on any shell invocation

Dealing with a nice list of Linux (and Solaris) servers, I find that 90% of my users need the same environment variables with a few specifics unique for an individual user. My goal is to eliminate ...
1
vote
0answers
166 views

Using cgroups to write a job scheduler

One problem with cron is that if there are more jobs that can reasonably be run at a certain time, cron doesn't care: it will happily spawn the jobs anyway resulting in poor performance for all of ...
1
vote
0answers
35 views

Minecraft acting differently when started from terminal compared to started by cron job at start-up

So I use a CentOS Linux 7.2.1511 server, where I host a couple of things, amongst them a Minecraft server. Since from time to time server is rebooted I scheduled a cron job to run minecraft server on ...
1
vote
0answers
802 views

Linux password expiring and cron jobs failing

I have jobs running on a server which I access via powerbroker (so don't know the password). However the password of the user account expired recently and the said jobs failed. Due to password ...
1
vote
0answers
431 views

Crontab -e @reboot script doesn't start on restart

I add a string to crontab -e @reboot /home/user/start-ethminer.sh > /home/user/start-ethminer.log 2>&1 My /home/user/start-ethminer.sh file has the following content: #!/bin/sh screen -m -...