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)

-5
votes
1answer
71 views

cron - How many times the cron job will run when given aterisk(*) on all positions [duplicate]

If we define a cron job with * * * * * /some/task/to/perform, how many times the job will executed in 60 seconds?
0
votes
1answer
38 views

nginx stop logging after crontab modified the log file

I have a web server(django) running on nginx + gunicorn. nginx writes its regular logs to: ~/myproject/log/access.log and it writes errors to: ~/myproject/log/error.log it works pretty well for ...
1
vote
3answers
52 views

Cronjob: E-Mail with Cronjob output from mailutils is empty

I am tempering with my cronjobs to change the sender and subject for emails sent by the cronjob. For sending emails I installed the mailutils package on Ubuntu 14.04. This is how I am sending my ...
-2
votes
1answer
33 views

What is the “cluster” cron job?

I understand that cron job is some task running automatically on unix-like OS. My server is ubuntu14.04 with webmin installed. I was trying to setup a cron job through webmin, there is this "cluster ...
7
votes
2answers
390 views

Why does `crontab -` remove crontab, and can it be cancelled?

I hurried and forgot the e in crontab -e before I hit Enter. A prompt appeared, so I closed with Ctrl+D, same as I usually exit input prompts. Now, without warning, my entire crontab is empty. ...
0
votes
0answers
34 views

Crontab by hostname

My system is having 3 nodes and the cron scheduling is defined in one of these 3 nodes. So while checking with crontab -l at times I am getting proper cron listings at times I am not as the node ...
0
votes
1answer
63 views

Debian: How to lock root account AND still use cron. (cron does not work while locked account :( )

I'm setting up a small private server which is connected to internet. For security reasons I would like to lock my root account after setting everything up and then use a sudo user for further ...
0
votes
1answer
35 views

MySQL Backup Cron Job

I have a cron job which backup up my MySQL database by exporting it. The script includes the root password to get the job done. I get the message: Using a password on the command line interface can ...
1
vote
0answers
15 views

How to change $PATH for crontab in Opensuse [duplicate]

I have a script written which works perfect on terminal however gives error when called through crontab. It took me a while that the problem is with the cron environment not my script. so I tried ...
1
vote
1answer
41 views

IPSec Tunnel goes down during long periods of inactivity

I have 2 AWS regions I have connected using an OpenSWAN IPSec tunnel. This works great in our production environment but in our test environment where 1 of the regions has long periods of inactivity, ...
0
votes
2answers
62 views

$0 empty in script when run by cronjob [duplicate]

I am trying to setup automated backups for an AWS EBS volume and using https://github.com/colinbjohnson/aws-missing-tools/tree/master/ec2-automate-backup to do so. The backup script used is the ...
3
votes
3answers
414 views

Cron appears to run but doesn't execute in the same way as when run manually from the terminal [duplicate]

I have a php script that connects to an external API returns some data and updates a database table. I can run this directly via my command line / SSH terminal and it works fine (takes about 5 minutes ...
-1
votes
1answer
59 views

bash scripts work fine when I run it from command line but not from cron [duplicate]

I have this bash script in runtests.sh file #!/bin/bash cd /Library/WebServer/Documents/protractor_clipboards protractor testscript.js When I do this on terminal ./runtests.sh But when I try to ...
0
votes
1answer
56 views

Error in crontab - bad minute

could anyone give me a clue what am I doing wrong in the crontab below? I'm getting bad minute error... Here the entries: 0,15,30,45 * * * * /usr/sbin/netdate -v time.server.com > /dev/null 2>&...
0
votes
1answer
97 views

Running cron job manually and immediately with PHP

I just wanted to run all my cronjob manually and immediately, following command works well in command line terminal but not working with shell_exec crontab -l | grep -v '^#' | cut -f 6- -d ' ' | ...
2
votes
2answers
85 views

nginx logs just failed weekly rotate, how do I determine why?

After I installed nginx, its logs have been rotating weekly as per a weekly cron job on Sunday 00:00 However this week the logs failed to rotate, and I can't figure out why. The only thing I can ...
0
votes
1answer
24 views

When triggered, run script at top of the hour

I have a service that must be started at the top of the hour, any hour. Whenever that service goes down (during a reboot, etc) PRTG Network Monitor will know. PRTG has the ability to run a script when ...
0
votes
1answer
26 views

Run every 10 minute but start from 5

I want to run my code each 10 min, I want do it with */10 * * * * ceasor sudo python /home/ceasor/Desktop/script.py but I want it start from 5 instead of 0, I mean want it run on 5,15,25,35,45,55 ...
0
votes
2answers
370 views

using flock with cron

I need to prevent a script from being executed multiple times simultaneously and so flock seems right up my street. What I can't figure out is if I need to manually delete the lock file after the ...
0
votes
1answer
174 views

Linux(redhat);Crontab; bash - script working from shell but not in Crontab - assigning command to variable fails

I know that my question was asked several times, but there is no solution for my problem. In my Company there is an Application running on a RedHat Mashine. Users connect a text Based GUI via ssh to ...
0
votes
1answer
40 views

CronD ignoring command and running hourly

Having a problem with Cron on Centos7 it appears to be running my command 5 * * * * root curl http://www.(removed)/Ebay/GetOrders.php every hour instead of the 5 minutes i set some of the log: ...
3
votes
2answers
52 views

Ran chkconfig but crond not starting on reboot on Amazon Linux

I am trying to get the cron daemon to start on reboot on an instance of Amazon Linux (Linux version 3.14.57-34.46.amzn1.x86_64). I have run: $ sudo chkconfig crond on If I run: $ chkconfig --list ...
-1
votes
2answers
69 views

Logrotate not run [duplicate]

I use ubuntu 14.04 I try to run logrotate each 10min and remove all logs files bigger then 2MB, I try a lot solution but nothing not work, my logrotate run just 1 per day, I try solution with moved ...
0
votes
0answers
14 views

(Git-) Process not ending properly [duplicate]

I use a cronjob to call a git pull every minute: MAILTO="" */1 * * * * /home/pull.sh script: cd /home/webdir git pull origin release | grep -v "Already up-to-date" >>/home/git.txt This ...
0
votes
1answer
145 views

Is it ok to run the `ntp` cronjob hourly?

I have several servers in Amazon EC2. Having noticed time difference on the instances I have installed ntp. I see /etc/cron.daily/ntp Cron job was added. Still I notice that, for some reason, the ...
2
votes
0answers
13 views

crontab executing my own script [duplicate]

It's the first time after ten years of linux os (debian). I've a script in user home: /home/user/bin/script1.sh with correct permissions. Using shell, script runs. Inside crontab: 30 13 * * * ...
2
votes
0answers
38 views

How to aggregate a large cron mail volume

How do you handle a large volume of cron mails (from a thousand servers) in a smart way? Main use case: a cron error comes in, but its severity does not warrant immediate action. However, I do not ...
5
votes
1answer
193 views

Secure yum-cron.conf configuration and prevent them from getting auto-updated

The last CentOS upgrade from December 3, 2015 rpmsaved the /etc/yum/yum-cron.conf file and replaced it with the new one on bunch of the servers I manage, which had previously been configured with the ...
1
vote
1answer
154 views

Logrotate running according to cron, but logs are not rotated

I run logrotate through cron with the script [alex@leia ~]$ cat /etc/cron.daily/logrotate #!/bin/sh /usr/sbin/logrotate /etc/logrotate.conf >/dev/null EXITVALUE=$? if [ $EXITVALUE != 0 ]; then ...
-4
votes
1answer
52 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
247 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
21 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
21 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
59 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 PATH=/...
-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 MAILTO=email@domain....
0
votes
1answer
96 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
27 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" >> /opt/...
10
votes
2answers
522 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
49 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
120 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 ip-list....
2
votes
2answers
133 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
25 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
49 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
127 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
228 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
48 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
24 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 ...
4
votes
0answers
93 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
40 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 ...