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

learn more… | top users | synonyms (1)

1
vote
2answers
131 views

Cannot edit crontab as non root user

When I use the command crontab -e on my Debian server as a non root user (in this case as postgres), I can't edit it because of "/tmp/crontab.SJlY0Y/crontab" [Permission Denied] crontab -l on the ...
0
votes
0answers
14 views

Shell script to monitor log files going over a certain size [duplicate]

Due to another issue I'm tracking down, one of my app servers occasionally starts generating a large amount of errors and then becomes unresponsive. For now, the simple solution is to restart the ...
0
votes
1answer
35 views

What does */13 do in a crontab?

*/n * * * * in a crontab means run every n minutes, if n divides 60 evenly. What happens for other cases, like */13 * * * *?
2
votes
0answers
14 views

Configure job to expire

I'm learning Linux at the moment and were doing some exercises scheduling jobs with cron and crontab, but I'm wondering if it's possible to limit the amount of times that the scheduled job is ran. ...
0
votes
2answers
56 views

Why does this Shell script fail as cron job [on hold]

I have the following in a shell script, when I run this script it works but when I put this as a cron job it does not work(nothing happens!). How come? script #!/bin/bash ...
0
votes
0answers
28 views

Please help me to debug this notify-send battery alert script

I used crontab -e to define the following: */5 * * * * env DISPLAY=:0 /home/max/.bin/battery-check.sh The contents of the script are: #!/bin/bash ...
0
votes
0answers
40 views

cronjob executes every minute but should execute every hour [on hold]

I have a script which should be executed every hour, which creates a new log file. But it executes every minute. I am really despairing. My entry in crontab -e looks like this: #Create new logfile 0 ...
0
votes
1answer
36 views

Null message body; hope that's ok

I have the following command below as part of a cronjob. When I run the command via cron or at the command line, I get Null message body; hope that's ok. The contents of the email are empty but when ...
1
vote
0answers
40 views

How to do version-control repository update in crontab?

I'm trying to automate version-control repository update in crontab. The following script /home/usr/mrbean/bin/update.sh works in interactive Bash command-line: #!/bin/bash ...
0
votes
0answers
14 views

Configure cron for daily NMon task

I want to configure a cron job for NMon to gather stats during all day, everyday. Leaving a file per day to dump into NMon Analyser. I know the proper command to get a spreadsheet format its ...
0
votes
1answer
24 views

CRON path problems

I have a Python script that runs from the command line beautifully, but when I try and run it from CRON does strange things. The script generates, then runs an apk script file. The apk script file ...
0
votes
2answers
244 views

Is this sar/sysstat cron job formatted correctly?

I want it to give me all the sar/sadc options, interrupts,disk,etc.. every 10 seconds starting at noon for the entire hour. On the second line I want to capture the info in /proc/interrupts every ...
2
votes
1answer
50 views

Cron job not behaving as expected

So I have a python script that pulls down git/svn/p4 repositories and does some writing to a database. I'm simply trying to automate the running of this script and based from what I see in syslog it ...
0
votes
1answer
29 views

Cron Log File Outputs Nothing

I get no output from my cronjob. The script the job is executing is: <?php require '/opt/bitnami/apps/wordpress/htdocs/wp-load.php'; ...
1
vote
3answers
42 views

Where is this cronjob running?

We have a news server running on a CentOS 6.5 box. It's leafnode, and a cron is set to run every two minutes. We decide to shut it down to troubleshoot other issues, so we comment out the line in ...
1
vote
0answers
38 views

Cron job scheduled to run on specific day-of-week is running on last day of month as well

I have a cron job scheduled to run every Thursday at 6am via the following schedule: 0 6 * * 4 It's been running as expected, but on Tues, September 30th it ran (unexpectedly) and again on ...
2
votes
1answer
71 views

To write this Pseudocode with Regex

I am doing a Makefile which I run regularly by Crontab every day at 0230 crontab -e; 30 2 * * * /bin/thePseudocode Python-like Pseudocode directories = ["Cardiology", "Rheumatology", "Surgery"] ...
7
votes
1answer
8k views

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

I have a script run from a non-privileged 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 ...
0
votes
1answer
21 views

Cron, crontab -e reads the wrong file

I do a simple: crontab -e In the top of this file, I have: #DO NOT EDIT THIS FILE - edit the master and reinstall. And I see that it has opened up some temporary file under /tmp I am using ...
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 ...
1
vote
2answers
54 views

cron will find certain commands on the PATH but not others

Having issues making crontab run certain commands, despite the PATH and SHELL being set correctly. Here is the env of the machine: SHELL=/bin/bash USER=ubuntu MAIL=/var/mail/ubuntu ...
2
votes
3answers
435 views

Cron job to check if PHP script is running, if not then run

I am wondering if someone might point me in the right direction. I've got little experience working with the Linux command line and recently due to various factors in work I've been required to gain ...
27
votes
1answer
1k views

Why aren't crontabs stored in user home directories?

I'm curious to know: why are crontabs stored in /var rather than in the user's home directories? It makes it a total pain to isolate these files for upgrades but I suspect that there is a logical ...
1
vote
1answer
25 views

Need to automate the updating of the crontab file

We have an automated process where a server is built, and after applications/middleware are installed using another automated process, and the crontab needs to be updated for those ...
1
vote
2answers
35 views

Do spaces matter in a crontab

It's not clear to be from the manpage for crontab. IS extra white space allowed between the fields? e.g., if I have this: 1 7 * * * /scripts/foo 5 17 * * 6 /script/bar 31 6 * * 0 /scripts/bofh is ...
1
vote
0answers
38 views

Maintain screen session when executing shell script on boot

On Ubuntu 14.04, I have a crontab entry set to run on reboot: @reboot /root/start_server.sh And here's start_server.sh: screen -dmS server bash -c "cd server ; ./run.sh" When the system starts ...
1
vote
1answer
33 views

High precision scheduler daemon

I'm looking for a scheduler daemon like cron, but with at least seconds precision so I can use it for a radio automation app. I've heard conflicting rumors about cron's ability to handle seconds. If ...
1
vote
1answer
34 views

Why can I not source a file with the default cron installed on a debian wheezy server? [closed]

I use cron for years now. In order to load all my environment variables at once, I define them in a dedicated file (often but not always .bashrc) that I source in the crontab: * * * * * (. ...
4
votes
3answers
6k views

How do I find out why cron is not running my jobs?

I'm using Ubuntu 14.04, and the cron daemon is running: # ps ax | grep cron 822 ? Ss 0:00 cron but it is not executing any jobs. I was previously getting entries in /var/log/syslog such ...
5
votes
3answers
682 views

Cron to not run on specific day but all other days

I have a cron setup to execute a bash script daily at 10pm. I have another cron setup to run monthly on the 1st of the month. Both crons launch a bash script, and the only different in the bash script ...
0
votes
2answers
1k views

How can I check if my cronjob is runnning on my server via PHP?

I would like to give out a warning If cron is not running or if a certain cronjob is not set in crontab on my server. Is this possible to check with php?
3
votes
2answers
508 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
51 views

How do I do “Hello World” to try using cron

I am using Fedora 20, and want, eventually, to set up automatic backups. I managed a trial run on my previous Fedora 12 installation, but can't get started again. I am using zshell. I thought I would ...
2
votes
2answers
80 views

How to make my bash script be able to create an log file for a clamscan running in cron?

I've created an custom clamscan(clamav) in bash and when I run it in my shell everyhing is fine, but if I run it in a cron, it can't create the log file. This are the errors: ...
1
vote
1answer
2k views

sh script will not execute as root (cron)

I have the following script added to cron. If I add touch thisisatest.file to the first line it will create a file named thisisatest.file, but not execute the rest of the code. If I manually type ...
0
votes
1answer
21 views

Why is there an apt-get script set in my cron.daily, I'm on Fedora 20?

I found this file tonight: /etc/cron.daily/apt.cron #!/bin/sh [ ! -f /var/lock/subsys/apt ] && exit 0 [ -f /etc/sysconfig/apt ] && . /etc/sysconfig/apt [ $CHECK_ONLY == "yes" ] ...
2
votes
3answers
974 views

set up local mail delivery to user from cron script

A line in my cron.daily script not work as expected. I haven't any special smtp mail server in system, this line rsync -avun --inplace /oneuser/file.xls /otheruser/file.xls| mail -s "$0 $?" ...
0
votes
1answer
97 views

CRON job to check if PHP script is running

I am having trouble regarding CRON jobs, I've basically got two php scripts that I want to keep running continuously on my server. Currently I am using an infinte loop to keep them going but they seem ...
0
votes
1answer
5k views

How to use Crontab for a java file in linux

How can I use Crontab in Linux specifically for a Java program? I want to run a MIS Script. How can I crontab it and what should the path be?
0
votes
1answer
41 views

openSuse, not running the cron job

I have created a cron job in the /etc/cron.d/dispatchingEmail_I the permissions of dispatchingEmail_I are the following: -rw-r--r-- 1 root root 84 Sep 11 19:52 dispatchingEmail_I content of ...
1
vote
3answers
84 views

Using nohup to keep a script running indefinitely

I am very new to Linux and I've only been using it to SSH to my web server using Putty. The issue I am having is this: Basically I've got 2 php scripts. One get_tweets.php constantly listens for ...
0
votes
1answer
27 views

Unable to install crontab on OpenSuse

I am running the following command as root, on OpenSuse: linux-gn77-PC:/home/harbir/project # crontab -e when the editor opens up I type the following, as I want the command to be run at 2145 hours ...
1
vote
1answer
30 views

Execute All Cronjobs in ~/.zshenv Environment

I want to execute all cronjobs in the environment defined in my ~/.zshenv, and I want to redirect STDOUT and STDERR of every cronjob to a single log file. I am on OS X 10.9. What is the cleanest way ...
2
votes
1answer
17 views

Send cron mails to root bundled every hour

Sometimes when there's a problem on my server, I get hundreds of emails in my root account which are caused by cron. I want to be notified about those problems but isn't there a way to bundle those ...
7
votes
2answers
8k views

crontab's @reboot only works for root?

man 5 crontab is pretty clear on how to use crontab to run a script on boot: These special time specification "nicknames" are supported, which replace the 5 initial time and date fields, and ...
2
votes
1answer
21 views

Incorrect cron for midnight?

I checked the crontab set by the hosting company and they have this: 0 * * * * /usr/bin/php /www/sites/[domain.com]/files/html/shell/indexer.php reindexall Does this cron run constantly or once at ...
5
votes
5answers
3k views

Check if script is started by cron, rather than invoked manually

Is there any variable that cron set when it's running a program ? If the script is running by cron, I'll skip some parts; otherwise invoke those parts. How can I know if the bash script is started by ...
2
votes
1answer
32 views

Qt program not invoked by cron

I had a simple Qt program, when running, it shows a simple window with a countdown timer. If you might be interested in the code, please see here. I had crontab line * * * * * ...
0
votes
1answer
33 views

How to create CronJob for running commands on reboot?

Via my host I have SSH access and a control panel. I installed Rails via SSH on a light weight server. I want to reboot the server when it goes down. I think I need to start it manually since I want ...
0
votes
1answer
62 views

Run screen command with variable & tick through cron (cron run .sh)

I run screen command through cron, where the codes is in lorem.sh files. This is cron codes: * * * * * cd /home/z; ./lorem.sh Inside lorem.sh: screen -S screenname -X stuff $'\033[B' sleep 1 ...