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)

-1
votes
2answers
160 views

running a cron job on a time interval [duplicate]

Is it possible to run a job for 2 hours at a specific time? So lets say I want to run wget command that calls/hits an endpoint in my web app for 2 consecutive hours in a day. Meaning that every single ...
0
votes
1answer
46 views

Include executed cron command when outputting to log

Is there a way I can include the command that was executed in the output when I'm logging to a file? For example: * * * * * date && /path/to/php /path/to/script.php >> cron.log ...
1
vote
1answer
33 views

Cron: where is the /etc/cron.d defined? Is it possible to add a new directory?

In CentOS, where is the /etc/cron.d folder defined? Is it possible to add a new folder that works exactly as it? Example: I have another folder ( /mnt/software/cron ) full of files with the exact ...
1
vote
1answer
131 views

dhclient asking for new routing every 1500 seconds, removing my static routing, cron not working

I have a problem with cron job on my ubuntu server 12.04. I have two internet providers - one for fast speed, second - for local resources. So, I'm using command route to up the static routing for ...
1
vote
3answers
2k views

How can I run a Cron job to make backups of a MySQL server by SSH

I have a production server running CentOS with a MySQL database. At home, I have a QNAP NAS (runs a little embed linux). I want to make a Cron job on my NAS to backup the data from my CentOS ...
0
votes
1answer
79 views

Crontab issue with specific days execution

We have a cron job under a specific user's crontab which should be running only on working week days. Job was running all days before we changed it. After we changed in the following line the days ...
-1
votes
2answers
200 views

Not sure how to set up cronjob properly to run php function

Im not sure on how I should do to set up a cronjob to run a php function for my website, and doing so by using a URL. I dont want any output etc, I just want the cronjob to run the php function buy ...
0
votes
1answer
99 views

Can't stop LAMP graceful restart

I just got my first LAMP up and running, everything works fine except that my server is restarting itself every sunday. When I read the logs I see "Graceful restart requested, doing restart" Should ...
4
votes
2answers
2k views

Setting timeout for cron jobs

Do Ubuntu Linux cron (Vixie cron?) support setting timeout for its jobs? Specifically, the process would be killed after X seconds unless it finishes successfully by then. I have had some cases ...
-1
votes
3answers
533 views

Are Linux cron Jobs each executed sequentially or in parallel?

Lets say I create two cron jobs: Cron Job A, runs every day at 8:00AM Cron Job B, runs every day at 8:05AM However, Cron Job A, takes 12 hours to run (don't ask why, this is an example). Will ...
0
votes
1answer
484 views

Why won't this shutdown shell script work under root's crontab when the guest user is logged in? [closed]

I've got a laptop running Lubuntu 13.04 and guest account enabled. People forget to shut it down every day so I figured I'd just put a one line script into root's cron to solve that. No dice. It shows ...
0
votes
1answer
411 views

cron.hourly script executing multiple times

The setup I have a script /etc/cron.hourly/msm-hourly that contains this: #!/bin/sh LOGPATH='/opt/msm/servers/cronscripts' LOGFILE="$LOGPATH/msm-start.log" # Make restart dead servers echo "" ...
1
vote
1answer
563 views

Crons not working on ISPConfig3

I have a CentOS LEMP stack with ISPConfig3. Everything is working perfectly, except for the cron jobs. I have tested the commands from command line, and they seem to be working fine, but when I put ...
-1
votes
1answer
550 views

How can I check cron task it's running? [duplicate]

I put a cron script in /etc/cron.d: [root@node ~]# cat /etc/cron.d/reconfig 0 */6 * * * root /root/bin/reconfig.pl But I get no list of cron tasks for root: [root@node ~]# crontab -l no crontab ...
2
votes
1answer
47 views

Aggregating emails from cron and cfengine

I've recently taken over administration of a decent size network (900 FreeBSD or Linux hosts across 10 physical sites) where we get a lot of email destined for root, mostly from cfengine (v2). We've ...
0
votes
1answer
239 views

cron job not running the script that start vncserver

Hi I wrote a script to start my vncserver when I call it manually via command line. It works as follows: the script is in usr/bin I gave it the right authorization (chmod u+x startvnc) but wen I ...
0
votes
3answers
168 views

script bash can't get difference in $PS1 or $- when running interactivelly or via cron

I want my cron scripts being executed verbosly when run interactively by a system user (for debug purpose for instance) and quietly otherwise (for cron, as I want receive e-mail if and only if I get ...
1
vote
2answers
340 views

crontab failing to start service via working script

My script works when ran by itself but not via crontab Crontab [root@someserver:/]# crontab -l SHELL=/bin/bash ...
4
votes
1answer
4k views

What cron job is /usr/lib/sa/sa1

I have logwatch enabled for my machine. Suddenly I see this line in my logwatch /usr/lib64/sa/sa1 1 1 : 4297 times /usr/lib64/sa/sa2 -A : 29 times run-part /etc/cron.hourly : 716 I tried crontab -e ...
1
vote
2answers
63 views

Is there a way to source cron jobs from a file

One of our servers has around 20-25 different cron jobs scheduled on it. Usually, we periodically check-in the cron jobs to a file in the repo using crontab -l > cron.jobs While bringing up a new ...
0
votes
2answers
49 views

Can I combine Cron special string “@reboot” with regular scheduling?

In the Cron manpage it mentions the special string "@reboot". Can I combine this with a regular schedule? The goal is simply to schedule a job to run once a day AND immediately in the event of a ...
1
vote
1answer
608 views

Strange syslog for my server

Today i go on my log with nano /var/log/syslog I have this, and i think it's not very good : Aug 27 06:25:02 ks3309528 rsyslogd: [origin software="rsyslogd" swVersion="4.6.4" x-pid="2235" ...
2
votes
2answers
362 views

check if process is running, even under cron

I have a cron job that runs every minute, but if it finds data, might take many minutes to finish. I need to tell if another instance of the script is running from another. To make things even more ...
3
votes
3answers
123 views

How can a sh script determine if it was started as a cron job as opposed to interactive or background?

I'd like to use the same scripting for cron and interactive, just wondering if there was a universal way over UNIX/Linux systems to easily make this determination.
-1
votes
2answers
913 views

Cron permissions (root, usergroup) - could not open input file [closed]

I have a server for which I have created a cron job "sendalerts" to users. Mind you this "sendalerts.php" should be runnable from two methods (via browser and also via a cron job) So cron's job is to ...
2
votes
2answers
2k views

Incrond running but not executing commands CentOS 6.4

I have copied this question over here from StackOverflow... I have installed incron from the EPEL repository (0.5.9) (before you ask; YES, I also tried downloading the source and compiling locally ...
1
vote
1answer
128 views

Script doesn't work as cron job [closed]

I have a script that I wrote to verify on an OS X machine (v 10.7.4) if a volume is up or down. If it goes down, it is supposed to send an email. When I run the script from the command line, it works ...
0
votes
1answer
346 views

How to stop long-running cron process from being killed

I have a long-running cron process, running a Python script, that seems to get randomly killed. In dmesg I see: [230568.077358] init: cron main process (890) killed by TERM signal [237517.974422] ...
0
votes
0answers
190 views

Cron sends e-mails but shouldn't

I'm getting crazy. Cron bombs me with e-mails, even if I set a nullstring as e-mail address and pipe the output to /dev/null. Currently my crontab looks like this MAILTO="" # m h dom mon dow ...
1
vote
1answer
197 views

cron create output file only if there is output

I have a cronjob that calls a script. I want the output to be placed in a log file. The problem is that the log-file is created even if there is no output. Since the job runs once an hour, and ...
0
votes
1answer
459 views

Issue with ifconfig in a shell script (using cron)

If I execute this script manually in Debian: #!/bin/bash /sbin/ifconfig wlan0 down /sbin/ifconfig wlan0 up sudo iwconfig wlan0 essid "WLAN_NETWORK" sudo iwconfig wlan0 key myPassword sudo dhclient ...
0
votes
1answer
137 views

celery tasks from one domain appear on another domain's django admin hosted on the same box

I have a rather funny problem that I didn't manage to find it elsewhere. I have 2 django-celery projects running with redis on 2 different domains, but apparently hosted on the same box. I don't have ...
0
votes
1answer
62 views

Strange crontab behaviour [duplicate]

This evening I have been playing with cron for the first time, and have started experiencing strange results. The script that I am trying to run is a watchdog that allows me to manage a couple other ...
1
vote
2answers
146 views

Redirect output from cron in real time, not after program has finished?

I have a ruby script that writes to STDOUT and sometimes STDERR. I am running this script every 5 minutes via a crontab: */5 * * * * /root/myscript.rb >> /var/log/myscript.log 2>&1 What ...
0
votes
1answer
334 views

Cron job does not generate expected log file

I'm trying to execute a shell with crontab. The cron job executes the shell but doesn't generate the log file i need. This is what i'm using for my cron: 10 * * * * /home/user/3nvo.sh This is a ...
0
votes
2answers
1k views

Ubuntu Crontab or init script startup [duplicate]

What am I doing wrong here with cron on boot? Example: To launch manually: screen -S example ./script.sh To recover manually: screen -x example now, I just try to do the same thing (well, the ...
0
votes
1answer
99 views

How to set “Max. Allowed Cronjob types (chrooted and full implies url)” to Full Cron for the ISPConfig admin user?

I'm using ISPConfig with the admin account and created a couple of sites. When I add a cron job the following line is added in the /etc/cron.d/ispc_chrooted_web3: SHELL='/usr/sbin/jk_chrootsh' ...
-2
votes
1answer
145 views

CRON to run every 15 minutes for one week?

How do I create a CRON job so that it runs every 15 minutes (24 hours a day) but for one week only and exits? Thanks!
4
votes
1answer
276 views

How can I create cron jobs in specific files on Linux Centos

I want to have a separate folders for cron jobs like: /mydata/cronjobs Now in that folder I want to have files like backup_server which will have the content like: 30 3 * * 1-5 ...
1
vote
2answers
735 views

How to prevent termination of long-running Python script

I have a cron job running a Python script on a VM-based remote Ubuntu server. The script takes a couple hours to run, and I'm noticing the kernel appears to be terminating the script before it ...
-1
votes
1answer
437 views

Plesk cron iOS notifications randomly stopped working [closed]

Recently, I started getting these cron error from Plesk. This cron controls push notifications to Plesk Manager on my iPhone/iPad. Obviously, turning off the cron stops the error but I want the cron ...
1
vote
1answer
55 views

Cronjobs putting archive in wrong directory

I am running a website on an Amazon ec2 instance running the default Debian linux. I set up a cronjob to copy the site files, take a database imprint, and zip them up. I want to keep the file ...
6
votes
1answer
620 views

how to execute a command on the first, second, third and fourth Sunday of the month with crontab [duplicate]

I have 4 servers and I want each one of them to execute a reboot on Sunday. Server 1 - first Sunday of the month (first week) Server 2 - Second Sunday of the month (2nd week) Server 3 - third Sunday ...
0
votes
1answer
70 views

what is the meaning of *this* crontab setting?

* */1 * * * sh foo.sh I found this setting on one production machine. And foo.sh was executed every one minute. I am guessing that the original author of this setting wants it to be executed every ...
0
votes
2answers
66 views

cron job to archive files older than xyz days [closed]

I would like to archive all of the files older than Xdays. the files are in /home/user1/ and i would like to move the archive to /home/user1/folder_backup/ i am running ubuntu server 12
1
vote
1answer
198 views

Crontab group permissions

I have noticed on my debian machine that the crontab user does not have read permissions on the /var/spool/cron/crontabs directory. drwx-wx--T 2 root crontab 4096 Jun 20 21:34 crontabs Further more ...
0
votes
1answer
319 views

Why is this cron job with shell script failing? [duplicate]

I created a cron job to do a daily backup, to store it in the directory /backups This backups directory is located at the root [/] of the VPS server and is a separate backups partition provided by ...
0
votes
1answer
46 views

Can't locate cron service, how to start it?

# rpm -qa | grep cron crontabs-1.10-5.noarch I have the above version of cron installed on my RHEL 6 server. My crontabs commands aren't reconginzed: # crontabs -l -bash: crontabs: command not ...
0
votes
3answers
731 views

script PHP doesn't work in crontab [duplicate]

Good morning, I have into my ubunut server a script that check into a database some value and if the condition is true send some email. If I launch into the browser the script like: ...
-3
votes
1answer
28 views

cronjob every sunday of the week [duplicate]

Hi all I have an ubuntu server where I want to create a cron every sunday al 23:00 I have read manual and I have try to use some cron generator. I have tried in this mode: 0 23 * * * root test.php ...