Questions tagged [cron]

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

290 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7
votes
6answers
1k views

Detecting cron tasks run by another user

I am currently working through the Nebula challenges on exploit-exercises.com, and one of the challenges relies on a script being run by cron. This is run by another user (flag03) and the user I am ...
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 ...
4
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-...
4
votes
1answer
255 views

How do I schedule a cron task to run

I'm looking to crontab a script every hour starting Friday at 5pm... ending Monday at 5am. This script checks if it's completed this week and if it's currently running. If no/no, start task. Off the ...
3
votes
0answers
44 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
1answer
169 views

Unable to initialize environment variables on startup

I have written a python script that runs successfully on raspberry pi if it is run manually from the console. As I want to start the script on reboot, I've written a bash script to change directory, ...
3
votes
1answer
203 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 ...
3
votes
1answer
2k views

How do I allow crontab use for local accounts that don't allow interactive logins?

Ok, here's the situation (you're welcome for the earworm): I am running a multi-server RHEL 7 environment with SELinux enabled. Due to DoD STIG controls, I do not have root access, but I do have a ...
3
votes
1answer
166 views

Let etckeeper monitor /var/spool/cron too

etckeeper should log all config changes on a system. But there is one important setting that is outside of /etc/: crontab -e edits a file inside: /var/spool/cron/ so there are important config files ...
3
votes
1answer
130 views

Hourly cronjob does not work

So just to sketch the outlines of this problem, i made an cronjob that should be executed on each full hour like this: 0:00, 1:00, 2:00. In all the manuals/tutorials i found on the internet they say ...
3
votes
1answer
74 views

How do I process new additions to logs

I know that I can use a few tools like tail and less to view the newest additions to a growing log file. What I want to do, though, is run some sort of script at regular intervals (like cron) on the ...
3
votes
1answer
581 views

Configure job to expire

I'm learning Linux at the moment and were doing some exercises scheduling jobs with cron and crontab, but I'm wondering if it's possible to limit the amount of times that the scheduled job is ran. ...
3
votes
0answers
402 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
40 views

User input in cronjob

I have created a script which calls another script.I'm implementing this via below cronjob 55 12 * * * cd /backup2 && ./script2.sh The another script ,I'm calling(restore1.sh) requires ...
2
votes
0answers
94 views

hourly cron job runs fine except at midnight

I have a cron job which is set to run hourly using 0 * * * *. The command is to run a postgres query and output to a file: 0 * * * * psql foo -f /home/foo/stats.sql >> /home/foo/stats.txt This ...
2
votes
0answers
28 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
2answers
731 views

Cron job still running after deletion from cron.hourly

I installed yum-cron on my CentOS 7 VM, but decided I did not need it to run hourly. So I tried to rename, and later completely remove, /etc/cron.hourly/0yum-hourly and /etc/yum/yum-cron-hourly.conf. ...
2
votes
1answer
801 views

WARNING: The following packages cannot be authenticated!

Problem: I get an email with the following message each day: Final-Recipient: rfc822; root@mywebsite.com Action: failed Status: 5.0.0 Diagnostic-Code: smtp; The email account that you tried to ...
2
votes
1answer
534 views

crontab time for execution not using system 'date'

My server was originally Eastern Time. But I used tzselect to change the timezone. Now typing date into the command line prints out the new timezone. But crontab still uses the old timezone to execute ...
2
votes
0answers
409 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
340 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
194 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
1answer
187 views

Raspberry Pi Python Talkey (TTS) + Cron

I have written this little Python script to listen to the BBC RSS Top Stories feed on my Raspberry Pi So first of all because I have problems with the 3.5 mm Jack (no sound), I went into sudo raspi-...
2
votes
1answer
156 views

rsync makes 2 backups if cron runs while file is being written

I have a crontab to run this rsync command every 30m rsync -rtbpgoi --suffix="."$(date +"%Y%m%d%H%M") --exclude=".*" \ --exclude="~*" --exclude="[Tt][Hh][Uu][Mm][Bb][Ss].[Dd][Bb]" \ --exclude="[Dd][...
2
votes
0answers
110 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
1answer
586 views

apt-get upgrade not installing upgrades through crontab job

After checking on how to make updates automatic with crontab, I've edited mine, as root, adding the following line: 00 11 * * * /usr/bin/apt-get upgrade -q -y >> /var/log/apt-upgrade.log Now, ...
2
votes
1answer
96 views

What do I need to do to finish this service/timer?

I'm trying to write a .service file to update my linux_logo uptime. I had this working as a cronjob in SysV init, but lost my example when I lost my system after upgrading to LVM. I have the ...
2
votes
0answers
514 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
538 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
1answer
2k views

Managing cron jobs across multiple servers

We are facing a problem with managing cron jobs over multiple servers with dependencies. I hope there is an opensource central management project that I can be used to handle that and report the ...
2
votes
0answers
123 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
797 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
363 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
4answers
740 views

About executing a python program in a shell script which is scheduled on crontab

I have a problem with regards to crontab. I have a script named checker.sh and I want to schedule it so that would run every minute: * * * * * sh /home/pi/checker.sh I have the script here: The ...
2
votes
0answers
538 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
150 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
1answer
215 views

Remove tar compress spool from cron email

I have a crontab job that call a simple script to backup a website: 15 0 1,10,20 * * /home/username/bin/backup_whatever This is the script: #!/bin/bash TODAY=$(date +"%Y%m%d") FILE_TO_PUT="filename....
2
votes
1answer
63 views

Send cron mails to root bundled every hour

Sometimes when there's a problem on my server, I get hundreds of emails in my root account which are caused by cron. I want to be notified about those problems but isn't there a way to bundle those ...
2
votes
0answers
499 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 ...
2
votes
1answer
1k views

How can I periodically check if my network is up and reconnect if not?

I've written a script to periodically check whether my network is up by pinging three major sites and disconnecting and then reconnecting my network if all three fail. This script works fine from the ...
2
votes
1answer
459 views

Cron does not execute xinit command

I have a command that works perfectly when launched from the prompt: xinit /home/user/myscript.sh -- /usr/bin/Xvfb :1 -screen 0 1x1x8 But is not executed when put in crontab: @reboot xinit /home/...
2
votes
2answers
825 views

Cron job running but not establishing tunnel

I have a script which establishes a reverse tunnel on an endpoint HostB. It looks like this: cat tun.sh #!/usr/bin/env bash # Test code /usr/bin/ssh -V 1> /home/userA/bin/tun.stdout 2> /home/...
1
vote
0answers
26 views

Multiple Processes getting stopped with error “Resource temporarily unavailable” and “can't fork” resulting in crash

We are running a script on Dell Edge gateway 3002 to send data to cloud, but after running for 4-5 days the gateway becomes unresponsive(hanged state) and can't be pinged. The gateway has Ubuntu 18.04....
1
vote
0answers
29 views

reboot causes device to shutdown but doesn't start again for many hours after

I am using a BeagleBone running Debian. I have a cron entry in /etc/crontab which tells the device to reboot at 03:01 every night as follows 00 03 * * * root /sbin/shutdown -r +1 >> /...
1
vote
0answers
29 views

crontab: waitpid() failed waiting for PID xxx from “/usr/bin/sensible-editor”: No child processes

I have a problem similar to this one: after running crontab -e and exiting the editor (mcedit), the temp file is not saved, and the screen gets filled with a repeating error message: crontab: ...
1
vote
1answer
33 views

How to schedule a python script cron job that have packages in virtual environment?

I have my env where I installed all needed for me packages. And where I have my script that I want to put to the crontab. What I did, but there are a problem that when crontab running my script, of ...
1
vote
0answers
272 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
30 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 ...