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)

0
votes
2answers
34 views

$0 empty in script when run by cronjob

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
1answer
510 views

Cron Daemon Wget blocked

I've got nginx on Debian 7 without cpanel. I am seting-up my Crontab like this: */45 * * * * wget "http://example.com/cron-url.php" >/dev/null 2>&1 The above cron is being blocked with ...
1
vote
0answers
14 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 ...
95
votes
4answers
111k views

Why is my crontab not working, and how can I troubleshoot it?

This is a Canonical Question about using cron & crontab. The answer for 'Why is my crontab not working, and how can I troubleshoot it?' can be seen below. This addresses the cron system with ...
42
votes
7answers
23k views

Prevent duplicate cron jobs running

I have scheduled a cron job to run every minute but sometimes the script takes more than a minute to finish and I don't want the jobs to start "stacking up" over each other. I guess this is a ...
1
vote
1answer
27 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, ...
3
votes
3answers
238 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 ...
-2
votes
0answers
25 views

CentOS Crond Session Errors [closed]

My Machine is: OS: CentOS Linux release 7.1.1503 (Core) RAM: 80GB CPU: 24 Cores (48 Threads) In this server i have create almost 250 users and i'm running cronjobs every minute, in all of them. I ...
12
votes
7answers
8k views

Robustly disabling specific cron.{hourly,daily,weekly} script

On various systems that I administer, there are cron scripts that get run via the commonly-used /etc/cron.{hourly,daily,weekly} layout. What I want to know is whether there's any common 'disable this ...
-1
votes
1answer
23 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 ...
2
votes
2answers
71 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
2answers
857 views

Inside Docker container - crond running but no cronjobs executed

I have built a container from a Dockerfile, based on an Archlinux base image. Using a "RUN" command I have installed "cronie", since Arch does not come with any form of cron. Now, after the container ...
1
vote
1answer
54 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
2answers
2k views

Capturing output from a remotely executed command via SSH fails in CRON

This question is in a direct relation to this one: ssh fails to execute remote command when run from cron bash script - works from CLI I'm not able to comment on the accepted answer as I don't have ...
0
votes
1answer
30 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 ...
0
votes
1answer
1k views

Compress and remove logs from jboss on linux with cron

I need to compress and remove log files after some time from serwer. I have never write scripts before. So far i have script logs.sh: #!/bin/bash LOGS=/usr/local/jboss/server/default/log/ ...
0
votes
4answers
1k views

munin-cron Unable to Copy Contents

I recently installed munin on my (Fedora12 based) server. Now, I wanted to get all the graphs in a static directory (The application runs on Django). So, I edited the file /etc/munin/munin.conf by ...
0
votes
1answer
18 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 ' ' | ...
0
votes
2answers
690 views

Proxmox cron.daily log error

I am having a problem with cron.daily job in Proxmox. Its giving me this error: /etc/cron.daily/pve: Can't stat /var/log/pve/tasks/6: No such file or directory at /etc/cron.daily/pve line 78 The ...
0
votes
1answer
13 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 ...
2
votes
2answers
2k views

Setting 'From' header for cron email using msmtp

I've got msmtp setup on Ubuntu 10.10 so that cron can send me emails. That works like a champ, for the most part. However, emails coming to my gmail account show up as coming from (unknown sender), ...
3
votes
3answers
698 views

Is it possible to assign a nice and ionice priority to all scripts executed by cron daemon?

To be a bit more concrete: I have a Debian Squeeze Linux machine with a web application that should become available all over the planet. Until now I had a bunch of resource consuming cronjobs each ...
0
votes
1answer
22 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 ...
6
votes
3answers
169 views

cron job timing

I would like to start cron job at 9:30 and then work every 5 minutes and then stop at 16:30 everday. Is this kind of scheduling possible in one or do I need two cron jobs?
3
votes
2answers
10k views

how to run cron job every 3 months?

What would be the crontab entry look like for a job that runs on the first day of every third month?
1
vote
1answer
77 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 ...
3
votes
1answer
1k views

Jenkins/Hudson Can we monitor realtime result of external job from Console output?

I have some external jobs need to be monitoring from central Jenkins/Hudson server. Jenkins/Hudson just send job output after it finish. Some jobs run in very long time and we aren't sure it is ...
0
votes
1answer
74 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
2answers
36 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 ...
1
vote
2answers
1k views

Cron won't use msmtp to send emails in case of failed cronjob

I'm trying to configure a machine so that it will send me an email if one of the cronjobs output something in case of an error. I'm using Debian Wheezy. Cron is working normally (without the email ...
0
votes
1answer
37 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 ...
0
votes
1answer
12 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
0answers
20 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
vote
2answers
67 views

Crontab command not executed

Coming from Why is my crontab not working, and how can I troubleshoot it? i still don`t know why my command is not executed. I got same command for root and www-data and my cron logs shows that ...
15
votes
4answers
12k views

Is there a way to validate /etc/crontab’s format?

I prefer to stick scheduled tasks in /etc/crontab so I can see at a glance what's scheduled to run, regardless of which user the task runs as. The only gotcha is that the format isn't validated on ...
2
votes
2answers
141 views

Getting regular crons to stop for one hour a day - is there a better way?

I have a cron job that needs to run every 10 minutes, but should not be run for an hour each night ( from 5 to 6am ) while the system is down for a backup. As I understand it the following syntax ...
28
votes
6answers
4k views

Outgrowing cron: what's the next scheduler?

We've been using cron for about as long as I can remember to handle all of our job scheduling needs. Everything from storage clones/snapshots to reports against databases to daily system reports to ...
2
votes
4answers
6k views

Command does not execute in crontab while command itself works just fine

I have this script from Colin Johnson on Github - https://github.com/colinbjohnson/aws-missing-tools/tree/master/ec2-automate-backup It seems great. I have modified it to send email to myself every ...
-1
votes
2answers
33 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
1answer
59 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 ...
0
votes
0answers
13 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
130 views

Wal-E cron job not executing

I have a cron job setup that is suppose to be running the wal-e backup-push command. The command works fine if manually ran through the command line. As the postgres user of course. So I setup a cron ...
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 * * * ...
6
votes
3answers
147 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 ...
2
votes
0answers
26 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
82 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 ...
0
votes
1answer
1k views

ssmtp won't send cron email

I can't figure out why cron on my AWS EC2 (Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-32-generic x86_64)) can't seem to send email out via sSmtp to AWS SES. This works: echo "test" | ssmtp my@myemail.com ...
1
vote
3answers
920 views

How to restart PHP-FPM from cron?

I'm trying to restart PHP5-FPM periodically using Cron, but am having no luck. I can restart manually with no problems, using service php5-fpm restart or /usr/sbin/service php5-fpm restart However, ...
-4
votes
1answer
33 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 ...
1
vote
0answers
49 views

Arch Linux, cronie - can't run cronjob [duplicate]

This is beyond frustrating. I have an ARM box with Arch installed on it. Installed cronie, enabled&started: # systemctl status cronie * cronie.service - Periodic Command Scheduler Loaded: ...