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.

learn more… | top users | synonyms (2)

-4
votes
1answer
45 views

cron job runs in cron.daily, but not crontab file. Tried debug methods suggested already. [duplicate]

I apologize already for asking another cron question. I read dozens of help articles online with still no solution. So for my curiosity, I need to find a solution. I simply want to run a command ...
6
votes
3answers
192 views

find -delete works OK, but not with cron

PLEASE NOTE: I have read all the similar questions re. cron, paths, env variables and so on, but have found none that offer solutions to my particular problem. I have a script that makes some ...
0
votes
0answers
20 views

Cron Reports Running the Script but no Results [duplicate]

RESOLUTION Per the marked duplicate question above, I checked the mail box for the user running the script. I found that a fatal error was occurring in the PHP script when run by CRON. The error was ...
-2
votes
1answer
20 views

Rotate Old Files

I have a cron to backup 3 files every Hour, they are SQL backups - in the format name-name-bak-2015-12-1919:30:01.sql I need a way to rotate and delete the older ones say every 7 days? Thought of ...
0
votes
1answer
48 views

php script from sh from crontab die with no traces

in my crontab there is a script starting at 2:40 AM, executing some routines both from sh commands and php scripts starting from sh files. the line in crontab looks like this: SHELL=/BIN/BASH ...
-1
votes
1answer
35 views

Crons keeps sending to root

My crontab keeps sending emails to root user email. I have already tried to fix the problem by editing the followings: In /etc/crontab edited the following: MAILTO=root to ...
0
votes
1answer
72 views

Why cron adds question mark after log file name

I have created cron task using crontab but I get question mark at the end of log file name. */4 * * * * /usr/bin/php /path_to_cron/queue.php > /path_to_log_file/queue.txt Is there any way to get ...
1
vote
1answer
25 views

crontab day of month not working

My crontab is working even too much: today is the 21th (of november, 2015) and both of these lines gets executed. I really cannot figure out why. * * 1 * 0,6 echo "test in dom" >> ...
10
votes
2answers
494 views

crontab sends month-old emails

ubuntu 14.04 Mailserver: Postfix root receives dozen of emails from crontab. These mails contain PHP warnings. I've fixed the cause for these warnings. I've fixed every cronjobs to not send emails ...
1
vote
1answer
44 views

Cronjob to push MongoDB Backup via git

Task: Create a Cronjob that executes a bash script once every night. The bash script should do a mongoDB Backup and push it to a Git Repo. So I created a cronjob as the root user via the crontab -e ...
0
votes
2answers
116 views

Crontab unable to run program that calls credentials file [duplicate]

A newly created crontab job is failing because the program can't read a .json file containing credentials in the same directory. Both files are contained in a /home/deploy/app/ folder. Crontab ...
0
votes
0answers
23 views

Cron job is running but not executing entire script [duplicate]

I have a script which is being run via crontab. It seems to not be running the NMAP portion. #!/bin/bash DATE=$(date +%Y%m%d_%H%M)_MVT_INT_DEV nmap -p0 -oG /home/tyler/NMAP/$DATE.gnmap -iL ...
2
votes
2answers
127 views

Downtime-tolerant Linux scheduler with to-the-minute accuracy

I have a server that I want to be able to schedule jobs on, and I need to be able to specify when those jobs happen to the minute. There will be a lot of jobs. (Things like sending e-mail ...
0
votes
1answer
23 views

How to run script with diffrent frequency within a specified time frame?

I have python script which I need to run with diffrent frequency within a specified time frame. I tried to do this through crontab but I do not know how to bite it :/ My time intervals and ...
0
votes
1answer
46 views

Cron Apache Access Log Keep Certain Lines Remove Duplicates

I'm trying to create a nightly cron that keeps certain lines from the access_log (into a file), then removes (near) duplicates from that file, then empties the access log and restarts Apache. I have ...
3
votes
3answers
121 views

cron: send email to different address in case of failure

I've a cronjob like this: MAILTO=mymail@mydomain.com 30 00 * * * root /run/this/script.sh is there a way to tell cron to send mail to different mail addresses based on exit code? I mean, can cron ...
3
votes
1answer
171 views

bash if statment unexpected behavior in crontab job

Here is the script bash --version | head -n1 if [ "$1" == "now" ] then echo if now execut job else echo else "_"$1"_" # make sure we are not picking any spaces if [ condition ] ...
0
votes
0answers
40 views

Script in user terminal works, permission failure in users crontab in Scientific Linux 7.1

I have a script that works to check if my VPN connection is up, and if not, it restarts it. This works correctly in a terminal, but the command nmcli con up uuid 7c514892-6a6a-4d33-946b-84aeb37615bb ...
0
votes
0answers
23 views

If cron as www-data/apache user have security issue?

Last year I checkout a server where I found some exploit bash script in /tmp folder which download a binary file from 3rd party server. When I further checked it, I found apache user's cron entry for ...
3
votes
0answers
81 views

`at` jobs running tens of minutes later than expected

I have an issue with at jobs being queued successfully and running successfully, but sometimes tens of minutes after they are scheduled to run. I confirmed that atd is running: me@hostname:~$ ps -ef ...
1
vote
1answer
34 views

lockfile-touch terminating intermittently

I'm having some problems with a bit of script I'm using for making sure a script isn't running twice. I've been using this for quite some time without much problems, but it is giving me trouble on a ...
1
vote
1answer
62 views

Executing php as sudo inside crontab [duplicate]

I've wrote a PHP-Script, and the execution requires sudo permission, because it executes some other system related stuff. So i've added this into the crontab -e but i can't see, that my script is ...
0
votes
0answers
31 views

Run Crontab command in jailed enviroment

I had created a user account in my server. And I created a jailed enviroments for that user. One thing i need is how to run crontab command in jailed enviroments. I tried add bash crontab to ...
2
votes
1answer
77 views

What is the meaning of “+” in crontab file and why it works?

I've found this cron command on some Ubuntu server in /etc/cron.d/. 0 */3+2 * * * root <command goes here> Tried this on my PC with Ubuntu 14.04.3 LTS by adding the following file: ...
3
votes
1answer
260 views

Run Cron daemon on OS X 10.10

I am maintaining some OS X 10.10 machines which require cron for various tasks (watchdog processes, /tmp cleaners, etc.). One of them has mysteriously stopped its cron daemon, and I can't seem to ...
0
votes
1answer
34 views

Cron output not working

Need help figuring this one out. I have the following script - /root/eximqueue.sh with the proper +x rights, etc: #!/bin/bash ######### Edit here ########## _mail_user=my@address.co.za # Set this to ...
0
votes
0answers
27 views

How to run script automatically after specific time? [duplicate]

I have two scripts to run backup task, one is for full backup, another one is for incremental backup. I want to run full backup at specific time every day, and run incremental backup every 10 mins ...
0
votes
2answers
18 views

Solution for backing up/copying from multiple destinations

We have 12 Debian servers that we want to copy a specific directory from to just one server on a weekly basis. This server will act as sort of a backup server. Any suggestions how to go about this?
1
vote
1answer
73 views

Cron jobs not working anymore

Cron jobs were working for months in the past but recently I had a high server load and now cron jobs aren't executing my php files (the same ones that were working before). When I check the cron log ...
1
vote
0answers
89 views

Running crontab on AWS auto scaling group

I have the following setup: 1 server with application X, that runs a crontab once an hour. The crontab connects to the database and runs some heavy calculations and exports data to a special data file ...
1
vote
2answers
75 views

Crontab - How to determine current active processes started by cron

We have a very sensitive application which heavily makes use of crontab and we would like to track of how many processes started by crontab are still running. In short, we have a limit of 300 cron ...
0
votes
2answers
69 views

Conditional block in crontab

Is it possible to put an "if" statement in a user's crontab, or is there another sensible way to organise lots of conditional cron jobs? From the end user's perspective, it would be easiest if they ...
0
votes
2answers
78 views

What does cron mail status 0x0047#012 Mean

I noticed in the mail log last night that I'm getting a new message: MAIL (mailed XXX bytes of output but got status 0x0047#012) The cron job did run successfully though (as it's a script that ...
0
votes
0answers
24 views

unable to force my cron job expression inside Hangefire tool to run on a specific hours

I am working on an asp.net MVC-5 web application. and i am using HangeFire tool to run background jobs. now i want my background job to run at 17 & 18 & 19 & 21 & 22 & 1. so i am ...
0
votes
2answers
211 views

Centos logrotate found error, skipping

One of our servers has a access_log which is nearly 5GB in size - there is currently no log rotation so I enabled it yesterday for httpd The contents of /etc/logrotate.d/httpd is /var/log/*.log { ...
0
votes
1answer
107 views

Script Works in Terminal, but Not as .sh

I have a script that works in the terminal perfectly, but for some reason won't fire off either in cron or when I run the script manually. I don't know if it makes a difference, but it's running on ...
19
votes
4answers
2k views

How precise is a cron daemon?

Is the cron job scheduler really precise? I mean, I need a script to run every night the latest possible, BUT before 00:00 of the next day. I'd ideally run a cron job at 23.59 (or 11:59 pm), but ...
0
votes
1answer
24 views

Unison on bootup

So i have unison running thru a config file by default. In here it applies the wait=watch function so it syncs automatically. but i wanted to run unison on boot, but i haven't been able to this this. ...
0
votes
1answer
48 views

Cron job execution time

I added a job for backup to my cron jobs, using crontab -e: 0 0 * * * tar -czf /somewhere/backup.tar.gz --exclude='sth/backup' --directory='/var/www' sth But when I check the created file, with ...
0
votes
1answer
100 views

Cron job with PHP script doesn't work properly

One of my customers have PHP script which loads cvs file. When he execute this script via WWW it works properly - logs of loaded data are stored in /var/php/CLIENT/loaded.log. But when i try to ...
0
votes
2answers
50 views

Read cron schedule from bash script

Is it possible to get the schedule for a running job? If i have this line in my crontab * * * * * /home/test/test.sh Can i read the * * * * * from test.sh, and only for that script? I hoped there ...
1
vote
2answers
458 views

Create a cron job to run redis every 30 minutes if it is not running

I want to create a cron job that will run redis every 30 minutes if it is not already running, but I don't know what I should do. I know that the beginning should look like this */30 * * * */<some ...
0
votes
1answer
36 views

Aws - Ubuntu - Cron job not running

I have a aws ec2 server with ubuntu on it. I did the following to set my cron sudo crontab -e 15,45 * * * * ubuntu /usr/bin/wget -O /dev/null https://mywebsite.com/cron/ But its not running.
0
votes
2answers
55 views

Puppet: Cannot find class cron

I'm using Puppet 3.4.3. I'm trying to use the cron type to manage cron jobs (as documented here: https://docs.puppetlabs.com/references/latest/type.html). However, any time I try and run my ...
-1
votes
1answer
61 views

Cron: Execute python script, capture stdout & stderr and send via msmtp [duplicate]

I try this for almost 4 hours now, in different ways. I googled a lot, but nothing I try work as expected. I have a simple .msmtprpc file, that allows me to send mails like this: echo -e "Subject: ...
12
votes
3answers
957 views

Running a cronjob with different parameters each day

I am a programmer, and do not know a lot about crons, but I want to know if this is possible. Lets say I have an array [option1, option2, option3] and a script which I run in NodeJS called script.js. ...
-2
votes
1answer
64 views

Crond is running twice with CentOS [closed]

I have the following issue that all of my cronjobs are running twice. When I do: ps aux | grep cron I see the following: root 1379 0.0 0.1 117296 1224 ? Ss Aug26 0:00 crond ...
1
vote
3answers
166 views

No log file output (or email with output) running Python script via cron job

I have the following cron job running a Python script which seems to install okay with no issues after creating it in Crontab and saving (this is on a server running Centos7). I'm not seeing either a ...
-4
votes
1answer
57 views

Cron every 5 minutes 8h to 20h [duplicate]

I searched for 15 minutes and to me the syntax still isn't clear... would this: */5 8,9,10,11,12,13,14,15,16,17,18,19,20 * * * run the job every 5 minutes from 8(8am) to 20 (8pm)?
1
vote
3answers
128 views

auto-attach EBS volume to a Spot instance

I need some persistent storage across spot terminations. My approach to solve the problem is Write a startup script that attaches and mounts the persistent volume Snapshot this state and register ...