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

learn more… | top users | synonyms (1)

1
vote
2answers
335 views

Is it possible to have a cron job run more frequently than once every minute?

CentOS 6 I have a shell script that performs a task every minute. The task itself only takes a couple seconds to complete and ideally I'd like to have this shell script execute 2-3 times per ...
0
votes
2answers
1k views

Xdotool using “DISPLAY=:0” not works in Crontab

I need to run shell script contains Xdotool codes in /home/z/Desktop/tempo/run.sh. I've tried many ways of DISPLAY=:0 but always not works. I've tried each of below codes, and not works: * * * * * ...
4
votes
2answers
4k views

cron ignores variables defined in “.bashrc” and “.bash_profile”

I have defined "SHELL" variable in /etc/crontab file: [martin@martin ~]$ grep SHELL /etc/crontab SHELL=/usr/local/bin/bash [martin@martin ~]$ file /usr/local/bin/bash /usr/local/bin/bash: ELF 32-bit ...
0
votes
1answer
183 views

top not working

My below cronjob is not working. What am I doing wrong here?? */5 * * * * /usr/bin/top -n1 | head -10 >>/tmp/load.txt
0
votes
2answers
135 views

Running something in a cron environment?

Cron executes whatever program is sent to it in such a fashion that anything written to STDERR causes either the kernel (or cron I'm unsure) to receive SIGPIPE. How does this functionality work? Is ...
2
votes
3answers
573 views

Crontab entry with hour range going over midnight

Is this valid crontab time specification, doing what is expected: 0 22-4 * * * Or is it necessary to do something like 0 22,23,0,1,2,3,4 * * *
2
votes
1answer
1k views

Users home path in a bash script

I'm writing a bash-script that will be run as a cron job everyday. Very basic, I was wanting to change the wallpaper daily. I have mint-14 with mate. The thing I'm getting caught up on right now ...
3
votes
4answers
331 views

How to stop monthly cron output email

Server is Debian 6.0. In /etc/aliases I have; root: me@mydomain.com This is so that root emails get sent directly to me. Today, a monthly script I have placed into /etc/cron.monthly has emailed me ...
2
votes
1answer
118 views

Location of crontab job created by non-privileged user

The issue I currently have is someone has created a crontab process to run on a RHEL 5 box, yet has not left me any privileged user information. How can I execute this cron job that was setup to run ...
4
votes
1answer
175 views

Where is the cron timer

Is there any way to access the cron timers and get the seconds left until the next execution of scripts in the crontab or maybe the seconds since the last?
0
votes
1answer
191 views

ipset not executing from crontab

I have this txt files that contains IPs, one per line of file, that I want to block using ipset. I have this bash script that essentially reads from the plain txt file and constructs an array. Then ...
1
vote
3answers
1k views

Why can't cron job find basic Linux commands?

I'm trying to set up a cron job to run a PHP script daily as part of a web-based booking system. It's been running perfectly for several years on a different Apache server using this in the crontab: ...
-1
votes
3answers
1k views

How to run a shell script with export command in crontab

I have a shell script that exports values of variables when executed. The same values will be used in another script. How to run this script(test.sh) in cron. #!/bin/sh export I="10" echo $I I will ...
1
vote
0answers
134 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
101 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
79 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
98 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
980 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
177 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
558 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
187 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 ...
3
votes
2answers
456 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 ...
1
vote
1answer
273 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
233 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
538 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
220 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
154 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
367 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
196 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
198 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
2k 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
279 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
890 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?
3
votes
1answer
9k 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
117 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
716 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
2k 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
636 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
270 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
5k 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
533 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
825 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
920 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
470 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
3k 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
536 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
10k 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
341 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
472 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
2k 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 ...