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

learn more… | top users | synonyms (1)

1
vote
0answers
121 views

External HDD read/write permission changing from a cron job

So, I run an overnight python script that runs a backup of our web data in the /var/www directory, then moves the backups to an external HDD in /media. The script in scheduled in the sudo crontab ...
1
vote
2answers
94 views

Third cron field doesn't seem to work (job runs when I don't want it to)

I scheduled a job like this: * * 6-8 * 1-5 echo "test" >>/tmp/test.log 2>&1 I expect this job to run only on 6th,7th,8th, these 3 days. but today is 18th, it still runs. What ...
1
vote
0answers
73 views

Lock a script starting daemons

I'm run a script with cron: */10 * * * * flock -n /tmp/lock script I have to make sure that only one instance of the script is running at the same time, and for that I'm using flock. The problem is ...
1
vote
2answers
93 views

Cron creates vim process but does not display vim

Under MacOSX 10.8.2 I am able to run vim as follows in the bash shell: /usr/bin/vim -c "normal G" -c 'startinsert' ~/.journal If I put the exact same command in a script: #! /bin/bash export ...
2
votes
2answers
757 views

How do the internals of the cron daemon work?

I want to know how cron works internally. Does the process keep checking the current time in an infinite while loop (thus continually consuming CPU cycles)? Or does some function generate an interrupt ...
0
votes
2answers
152 views

Lock folder when running cron

I am setting up my first cron on a Ubuntu Desktop system. I was curious to know if there is a way to lock a folder before a cron is ran and how to set it up? I am following this article. I am just ...
15
votes
6answers
531 views

How to Find a Fugitive Crontab

A few years ago I setup a cron job to automatically ping a URL every minute as part of a monitoring system (that's oversimplification, but it'll do for this question). Because I'm a horrible person, I ...
3
votes
1answer
165 views

How can I peek at the output of a running crontab task on OpenBSD?

I have an hourly hour-long crontab task running with some mtr (traceroute) output every 10 minutes (that is going to go for over an hour prior to it being emailed back to me), and I want to see the ...
1
vote
2answers
357 views

Use /etc/aliases for outgoing mail relayed by postfix with local domain

I'm using Ubuntu 12.04 with postfix configured as satellite system that relays outgoing mail to Gmail. For sake of example, my registered domain is example.com I want root cronjobs' error output to be ...
0
votes
1answer
215 views

Cannot edit crontab

I'm running RHEL 5.6. I type $ crontab -e and all I see is Killed I am, however, able to edit a file (let's say I call it crontab.in) and then type $ crontab crontab.in $ crontab -l and see ...
0
votes
1answer
207 views

How can I check if a file is being downloaded?

I have a Raspberry Pi which I want to use to automate downloads to a network drive. I would like to restart the machine on a regular basis using cron (I've heard they're not the most stable of ...
0
votes
5answers
399 views

cron job schedule

I created a cron job using * */2 * * * schedule. Can anyone tell me what schedule this refers to? I guess it should execute every 2 hours, but it seems to execute every minute.
0
votes
0answers
190 views

CakePHP shell as cron permissions issue

First to say that I know basics of Linux systems. I am familiar with cron jobs. I am using CakePHP shell as cronjob. The script is using model's method to download pages from site user entered. ...
1
vote
1answer
144 views

Crontab with Github

I want to be able to push a repository to Github at midnight, every night. I know that Github isn't a back-up service, and, in no way am I expecting it to be this - I just want the best up-to-date ...
3
votes
2answers
257 views

Can I use variables in crontab file?

I mean I want to use this variable at "minute to wday" in the following. minute hour mday month wday who command Because I want to set these values in some configuration file and want ...
1
vote
1answer
178 views

security concern around adding cron user to web application group

I have a permissions issue on my CentOS 5.6 machine with regards to the cron user. On my test/staging environment my cron user (picco-cron) is a member of one group - picco-cron, as below: ...
3
votes
3answers
167 views

Mail cron output only when Git throws a real error

There exists a Git repo that is on one server, we want to generate doxygen output for it on a different server. The following command works for me but has the downside of sending a mail everytime the ...
5
votes
2answers
1k views

Scp doesn't work in cron

Yeah, I know it's classic. I've googled it all around, but still it doesn't work. I have the following script: #First go to SVN repo folder cd $svnrepos # Just make sure we have write access to ...
2
votes
1answer
265 views

PHP phantom cron job

I disabled all my cron jobs by putting a # in front of them. Except for one: @reboot echo "Hi I rebooted" The rest are: #0 2,14 * * * /home/backup1/mysql-backup.sh #0 * * * * mono ...
1
vote
2answers
695 views

Can a crontab job run concurrently with itself?

If I have a crontab job that runs, for instance, every hour, but that job may take more than an hour to complete, will the next job fail to run?
2
votes
1answer
7k views

Crontab job start +1 min after @reboot

Need a script executed at each reboot in +1 minute. I placed a record @reboot but it is too early for my script. How to execute it sometime after reboot?
0
votes
1answer
110 views

run-parts ignores jobs.deny

I use run-parts to run all scripts under a directory,the same way crontab does. But the jobs deny and jobs allow don't block any of the scripts in the directory. rajeevs@rajeev:/home/rajeevs/test$: ...
4
votes
2answers
472 views

Have cron email output to MAILTO based on exit status

I have a cron job running a php command like this: php /path/to/script.php > dev/null This should send only STDERR output to the MAILTO address. From what I gather the php script is not ...
1
vote
2answers
1k views

how do I run a cron job with a specific user?

My cron and scripting skills are very poor, but I need to run a job every 5 minutes by user 'cpc'. So I created a script and left it at /root. My crontab -e entry about it is: 0-59/5 * * * * ...
8
votes
2answers
540 views

Interactive shell with environment identical to cron

I am aware of a lot of pitfalls in the magic world of crontabs, but sometimes it would help troubleshooting a lot when you have some smart way to enter an interactive (bash) shell with exact identical ...
2
votes
2answers
182 views

How do I check active crons?

I'm trying to hunt down a cron job (or the equivalent) which I know is running, but I can't find it in the default cron files for my system (FreeBSD / Linux / BSD). How can I tell which ones are ...
-3
votes
4answers
4k views

Cronjob for rebooting everyday

I have set this cronjob because I want my server to be rebooted everyday at 05:00 # file: /etc/cron.d/reboot * 5 * * * root reboot &> /dev/null I think it worked the first time as I was ...
1
vote
0answers
492 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 ...
1
vote
2answers
635 views

CentOS, PHP file is running from browser, not from cron daemon

I am working on CentOS. I have created a PHP file which run from browser http://mydomain.com/backupfile/dobackup.php I have added the script from crontab and made the file executable, but it is ...
4
votes
3answers
688 views

How to get which version of cron daemon is running

Background: I am working on CentOS Details # cat /proc/version Linux version 2.6.18-308.4.1.el5PAE (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-52)) #1 SMP Tue Apr 17 ...
2
votes
1answer
382 views

/etc/crontab edited via copy and paste, how to revert back?

I have made a mistake, I have edited /etc/crontab via copy and paste. And now those crontab entries are not working. [root@process ~]# cat /etc/crontab SHELL=/bin/bash ...
1
vote
2answers
2k views

Watchdog script to keep an application running

I currently use an application called MxEasy on my linux servers to display video from a couple of IP cameras. The software is rather buggy and crashes occasionally. I've wrote a script that checks to ...
-4
votes
2answers
500 views

Who can use cron? I can't help myself. Who is using cron? [closed]

I want to run cron every minute OR hour xclock. It's not that simple as I guessed:( I'll wait for your answer, sir. Maybe It'll be too late, before the right answer as 1 2 3...
2
votes
3answers
5k views

crontab -e , then 0 * * * * = every hour; then xclock

After sudo crontab -e (it wrote "/tmp/crontab.XXXX70pN9h" 1L, 19C 1,1 All Then I saved the file. And to check..? (how? i don't know) And to check I ps -e | grep cron 29818 ? ...
2
votes
1answer
313 views

How to use crontab (Gentoo)?

First I installed and ran crontab: emerge cron crontab -e In another console, I ran man cron, but this has no examples of how to use crontab. Where can I get examples, and why are there none in the ...
1
vote
2answers
430 views

crontab and DST disagreement with different timezone

From a server hosted in Poland (UTC +01:00), is there a way I can consistently have a crontab entry run at 9am New York time (UTC -05:00)? For me this wasn't trivial since the daylight saving time ...
2
votes
1answer
1k views

Periodically download attachments from mail box

Is there a preferably CLI based program I can use to regularly (through cron for example) use to check a mailbox, and download the attachments into a folder? I have a mailbox called ...
1
vote
1answer
262 views

Cron job - permission denied creating a file

I have a cron job: #!/bin/bash fn=db.backup.$(date +%m-%d-%y).sql mysqldump -uMyUsr -pMyPass --add-drop-table dbName> $fn find ./ -name '*.Z' -type f -mtime +7 -exec rm -f {} \; I get an error: ...
0
votes
2answers
232 views

Why does this fail as crontab but works as script [duplicate]

Possible Duplicate: What’s wrong with these two cron job’s? I want to print a formatted output from a file containing lines of date, time, long number, and long number. I set LC_NUMERIC to ...
4
votes
1answer
9k views

How to redirect output to a file from within cron?

I have a backup script which I need to run at a particular time of a day so I am using cron for this task and from within cron am also trying to redirect the output of backup script to a logfile. ...
0
votes
1answer
272 views

cron to delete after executing

I have a cron job which unzips a file and executes it. The cron is set to unzip, execute and delete the .zip file after. It's executing fine but it's not deleting the file. Here's the cron: ...
2
votes
3answers
1k views

Conditional crontab command in bash script

How do I invoke a crontab command so that I can schedule to run a script with a 20 minute delay based on some condition? Edit: What if I wanted a command that schedules a script to be executed only ...
8
votes
2answers
6k views

Manually run a cron job / simulate running cron job?

I am new to cron and I want to test if cron's mailing stuff after an executed task and things like that work. Is there a more elegant way to test this, then setting a cron job to run every few ...
1
vote
1answer
258 views

Putty doesn't seem to start from python'd crontab

I have the following Python script, chmod +x'd. When I run this script from the command line and Putty has not been started, it launches putty: #!/usr/bin/env python from __future__ import ...
5
votes
2answers
184 views

How to schedule a job that depends on network availability?

I have cloned a git repository of some project. I want to automate git pull and compile the project once in a week. I am using a laptop which wont be on 24x7. Now, I cannot use cron as I should keep ...
5
votes
1answer
5k views

Why does cron silently fail to run sudo stuff in my script?

I have a script run from a non-privaleged users' crontab that invokes some commands using sudo. Except it doesn't. The script runs fine but the sudo'ed commands silently fail. The script runs ...
4
votes
1answer
162 views

Emptying a directory owned by another user weekly

I have a temp directory set up where users can place whatever files they need to send to other users via HTTP. The owner of this directory is an SFTP user, and cannot run cron jobs. I have one shell ...
0
votes
1answer
274 views

cron logging but not working on some commands [duplicate]

Possible Duplicate: How can I execute date inside of a cron tab job? I have a server in Amazon EC2 that I run a backup script on with cron. However, it is not working. To test out if cron ...
5
votes
3answers
2k views

How can I ensure my cronjob will run at specified time?

I'd like to know how I can check to see if my cronjob will run at the specified time I set it at. Is there anyway I can test this without having to wait for that time? Here are my crontab -l results: ...
6
votes
3answers
1k views

Run Script once a day with systemd

I want to run a backup script 10 minutes after booting up my machine but only once a day. Is it possible to build up such scenarios with systemd?