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

learn more… | top users | synonyms (1)

3
votes
1answer
2k views

Why does sftp hide the log from stdout?

I have a script a.sh, which has an sftp command: echo "Starting to sftp..." sftp xxx@xxx.xxx.xxx.xx << END_SCRIPT ls mput *.csv.gz bye END_SCRIPT echo "Sftp successfully." If I run it ...
0
votes
2answers
119 views

Testing Scripts

If I have a script called teiid.sh set to run daily by a cron job. The scripts purpose is to initialize the startup of teiid. How would I make a call to test to see the if teiid.sh is working ...
6
votes
3answers
722 views

sort at jobs chronologically

Possibly a simple solution I misplaced. How can I get the output of atq sorted chronologically, so I can easily see who's due to run next? The man page for sort doesn't have anything built-in to ...
3
votes
0answers
742 views

cron is ignoring MAILTO

I have big trouble with cron. On Debian 6, it is ignoring the MAILTO variable. Is there some other variable that has to be to set for cron to send emails to a different email address then local root? ...
2
votes
2answers
597 views

Is there anything in unix crontab to determine this should be executed in PST/CST standard time?

There is this thing in QuartzScheduler where we can say execute this in CST/BST/ or whatever timezone. This is also good when you want to execute some jobs in certain timezones and certain jobs in ...
1
vote
1answer
75 views

Setting up a cronjob as a file

I want to create a cronjob at my Ubuntu server by adding/modifying a file in the /etc/cron.d folder, rather than using crontab -e as it's not too easy to automate. I've managed to make a file looking ...
3
votes
3answers
2k views

How to schedule something run once using anacron?

Frequently within my scripts I schedule auxiliary tasks for later in the form: at now + 8 hours <<< "rm -f workfile.$$ >> $worklog 2>&1 " or at 11pm + $(date +%M) minutes ...
1
vote
1answer
185 views

Creating Cron Task to kill stalled/failed runs in a system

I was given a task to create a cron which finds, kills and clears old puppet runs that were not successfully installed. I am more or less looking for a starting point.
1
vote
2answers
322 views

need portable crontab host-checking/failover logic across Linux & Cygwin

A host-ping test that always works correctly from the interactive bash command line in Cygwin, is behaving incorrectly in its own crontab--always selecting the second host--and I can't figure out why: ...
0
votes
0answers
255 views

Facing issue with cron on embedded linux

I have a SAM9 based board running embedded linux using buildroot package. I added the crond and crontab support to busybox from make menuconfig and built the rootfs and flashed it to my board. The ...
10
votes
1answer
1k views

What does the following kernel message mean?

The following appears /var/log/messages, what that means ? Feb 19 22:51:20 kernel: [ 187.819487] non-matching-uid symlink following attempted in sticky world-writable directory by sh (fsuid ...
6
votes
1answer
3k views

What's the meaning of the slash in crontab?

I have seen a crontab record in system. 0-55/5 * * * * root <command> I read the crontab -e example files and I know the first position stands for minute. But I cannot figure out the ...
1
vote
1answer
185 views

Crontab Change location

I want to set a personal crontab in another folder and executed. For example I want it in /home/project/tasks/crontab Like that it's easier to add/delete tasks. Thank you for your answers.
0
votes
3answers
1k views

I want to set up a basic cron job that sends an email

I am running OS X 10.7 and I am learning unix commands. I would like to set up a very basic cron job that sends me an email with a certain message. How would I go about this. From what I have read, I ...
1
vote
1answer
327 views

How to create a cron which finds/kills/clears old puppet runs?

I am a new user of bash/cron, and I was given a task to create a cron which finds/kill/ and clears old puppet runs that were not successfully installed. The more help the better, but I am more or less ...
3
votes
4answers
779 views

command for counting number of active cron jobs in crontabs

Problem statement I have 5 solaris boxes, some have Solaris 10 and some have Solaris 9. All of them have many cronjobs in their crontabs. I would like to know number of active cronjobs available, so ...
5
votes
3answers
2k views

Frustrating issue where neither cron nor su -c runs my job (permissions?)

Updated (and snipped) with more details below. I've set up a cron script and I'm trying to debug why it's not running. [Snipped context testing, which is all ok; see revision 2 for details] The ...
2
votes
2answers
487 views

changing default shell to /bin/bash of at job scheduler like in CRON

I recently switched from 2>&1 >> to &>> Is there a way to have at use /bin/bash as the shell? By default it uses /bin/sh and the man page gives no indication how anything else ...
2
votes
2answers
538 views

Is crontab related to server performance?

I am using Solaris 10, and I am adding many cronjobs to my server's crontab. Currently I have 30 cronjobs in my crontab. one cronjob takes 8 hours to complete ,one other cron job takes 5 hours to ...
14
votes
2answers
1k views

Origin of the word cron?

Trying to settle a friendly argument. Is "cron" an acronym for something? Additionally, did it's current canonical name "cron" originate from something shortened for something like chronos or ...
6
votes
2answers
2k views

Logging ALL stderr output of crontab to file

For example, I can log stderr of one script in this way: * * * * * run_script.sh > /var/log.txt 2>&1 But I want to log stderr of all scripts in my crontab. I can append > /var/log.txt ...
21
votes
1answer
4k views

How can I execute `date` inside of a cron tab job?

I want to create a log file for a cron script that has the current hour in the log file name. This is the command I tried to use: 0 * * * * echo hello >> ~/cron-logs/hourly/test`date "+%d"`.log ...
2
votes
2answers
4k views

List currently running cron tab and stop it

I created a cronjob, it runs for a very long time but now don't know how to stop it. Please help.
6
votes
1answer
3k views

Meaning of “* */1 * * *” cron entry?

Somehow, I am finding it difficult to understand tweaking around * parameters with cron. I wanted a job to run every hour and I used the below setting: * */1 * * * But it does not seem to do the ...
5
votes
1answer
1k views

Running cron script with lynx fails to work

I'm trying to automate a login process that can only be done through a browser. I am using the lynx browser to script the actions required to do this. Lynx does this by dumping a user's keystrokes ...
4
votes
2answers
1k views

cifs write errors in cron job

EDIT: THE SOLUTION With Tim's help I determined that larger writes of data were failing versus smaller ones. Why they didn't fail when I ran the script interactively, I don't know...But here was the ...
0
votes
2answers
2k views

Sending cron output to email?

I'm trying to send cron output to an email address and am struggling... I'm running the following command: 13 15 * * 1-5 root /path/to/mysql-backup.sh 2>&1 | mail -s "Daily Database Backup ...
1
vote
1answer
133 views

Can I filter how often cron emails me?

I have a few cronjobs and one of them is run every minute. I had to take a website down for two hours and it caused an error on that one specific cronjob and I got almost 120 emails in those two hours ...
5
votes
3answers
802 views

Crontab job not emailing on failure

I have a cron job on Debian: 1 * * * * /home/paradroid/bin/myscript.sh >/dev/null There is an installed and configured MTA, and I have received emails when the script has a syntax error, so I ...
2
votes
4answers
662 views

Is there any handy command line tool to manage Cron jobs?

Would someone suggest any handy command line (NOT web) tool or script which adds, enables and disables Cron jobs? I am looking, for example, for the following (or similar) behavior: sh manageCron.sh ...
4
votes
2answers
4k views

How can I know when a cron job was killed or it crashed?

Usually when a cron job crash, it will leave some error messages in the log. We run shell script and some java program with cron job. Recently we found some weird thing out from the log. Obviously ...
19
votes
8answers
32k views

How can I run a cron command with existing environmental variables?

How can I run a cron command with existing environmental variables? If I am at a shell prompt I can type echo $ORACLE_HOME and get a path. This is one of my environmental variables that gets set in ...
6
votes
2answers
6k views

Can I change the default mail recipient on cron jobs?

I believe that if there is any output from a cronjob it is mailed to the user who the job belongs to. I think you can also add something like MAILTO=vivek@nixcraft.in at the top of the cron file to ...
1
vote
1answer
662 views

grep searchstring /etc/crontab strange behavior in BASH script

I am working on a BASH script which creates automated backups via the crontab. I am trying to use myVARIABLE=`grep backup /etc/crontab` to return lines containing "backup" if an entry has already ...
1
vote
2answers
2k views

Using rsync in a cronjob when a password is needed

Basically I have a bash script that fetches data from my server to perform a backup. As it is now I have to start that script manually, enter the password, and then wait for it to finish. I would ...
7
votes
1answer
2k views

List of modified files of the past 24 hours

Is there a reliable way to have a system that mails me the list of files that were modified in the past 24 hours inside a set of directories? (like /home/*/public_html/* and /home/*/*domains/*)
2
votes
1answer
71 views

App which can execute arbitrary code on different events

I've been looking for a simple activator which can execute some code when stuff happens, I haven't found anything yet. Maybe, I am not using the right keywords. It would be great if someone pointed me ...
9
votes
1answer
3k views

How do I enable locate and queue the database to be built?

On a new Ubuntu 10.4 instance, I tried to use the locate command only to receive the error locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory from using this command ...
14
votes
3answers
4k views

Are multiple @daily crontab entries processed in order, serially?

I want two jobs to run sometime every day, serially, in exactly the order I specify. Will this crontab reliably do what I want? @daily job1 @daily job2 I'm assuming they run one after the other, ...
1
vote
2answers
454 views

Crontab not triggered

I have a program written in C with OpenCV. It captures an image from the webcam and saves on the disk with the name given as an argument. I want to trigger it every minute, thus I inserted the ...
2
votes
3answers
3k views

/etc/crontab what does “test -x” stand for

In my /etc/crontab file I have: # m h dom mon dow user command 17 * * * * root cd / && run-parts --report /etc/cron.hourly 25 6 * * * root test -x /usr/sbin/anacron || ( cd / ...
3
votes
2answers
2k views

How to access X display from a cron job when using gdm3? [duplicate]

Possible Duplicate: Open a window on a remote X display (why “Cannot open display”)? I'm trying to run a cron job that needs access to my X session. I know my X session will ...
5
votes
2answers
319 views

cron every X exact meaning

In cron you can specify */n where n means every n times period, for instance in the first column is minute. */5 means every 5 minutes, but which minutes? 0, 5, 10, ...? What happens if the number ...
3
votes
1answer
442 views

Using rsync + cron to sync a machine behind a firewall with my dropbox

I have a machine (A) behind a firewall with no access to the Internet, on this machine I can NFS mount directories on another machine (B) which can access internet, and is accessible from Internet, ...
0
votes
2answers
2k views

Running Python script via cron with sudo?

Im using Linux Mint. I have written a python script that is designed to not be accessible to the logged in standard user but is still be executed while they are logged in. It is to run and log them ...
2
votes
1answer
873 views

crontab “0/15” minutes + “11-15” hour field: when does that end?

Given a crontab expression like "0 0/15 11-15 ? * MON-FRI", how is that parsed? I am correct in assuming the 11-15 does not mean "between 11 and 15" but "when the hour is 11-15, inclusive" - i.e. ...
7
votes
5answers
5k views

Run script in a non interactive shell?

I have a cron job that is running a script. When I run the script via an interactive shell (ssh'ed to bash) it works fine. When the script runs by itself via cron it fails. My guess is that it is ...
1
vote
1answer
3k views

How to remove obsoleted logs with logrotate?

I wanted to remove unnecessary logs automatically , like Xorg.log.0 , and other packed *.gz files , i really don't need that on a laptop system. However , i checked man logrotate , but only an entry ...
29
votes
10answers
15k views

Correct locking in shell scripts?

Sometimes you have to make sure that only one instance of a shell script is running at the same time. For example a cron job which is executed via crond that does not provide locking on its own (e.g. ...
1
vote
1answer
358 views

vixie-cron.x86_64 doesn't seem to execute jobs on crontab

I have installed crontab on CentOS 5.6 x64 via yum install vixie-cron.x86_64 Here is my crontab -e SHELL=/bin/sh 0 0 * * * cat /root/mysql-backup.txt | xargs ...