cron is a task scheduler based on clock time that runs on Linux-based machines.

learn more… | top users | synonyms

1
vote
3answers
622 views

The 'which' command returns nothing via cron, but works via console

I've written a little utility in haXe + Neko that needs to execute some GIT commands. To avoid hardcoding the path to the GIT executable I'd like to use the which command to find out where it is. ...
1
vote
2answers
2k views

Schedule a cron job ev X minutes, but exclude it from certain hours in the morning?

Is it possible to make a cron job run say, every 20 minutes, but make it not run for say, 1-4 in the morning.
1
vote
3answers
988 views

What's wrong with my cron job time schedule?

I'm trying to setup cron jobs for a website hosted on hostmonster.com. When I use the following it runs perfectly: * * * * * But whenever I make changes to these timestamps the script doesn't ...
1
vote
3answers
2k views

Why does this script fail when run from cron, but works when run manually?

I have a relatively simple bash script that works great when invoked directly, but fails when run by cron. Why does this fail and how can I make it work via cron? #!/bin/bash apt-get update -y ...
1
vote
2answers
328 views

Run Crontab anytime after 4pm

I am trying to run a script through crontab in osx 10.8.5 that will run at 4:30. 30 16 * * 1-5 /Library/Frameworks/Python.framework/Versions/2.7/bin/python /Users/lego90511/PycharmProjects/Stock\ ...
1
vote
1answer
92 views

Why this cronjob wont run

On debian squeeze as user root I add this cronjob with "crontab -e" */1 * * * * root /usr/sbin/ntpdate ptbtime1.ptb.de >> /var/log/ntpdate.log But this cronjob will not run, there is also ...
1
vote
1answer
3k views

CRON what is correct time code for every 6 hours?

I just want to know which one should work just fine for Run every 6 hours forever: 0 */6 * * * or * */6 * * * Thanks
1
vote
1answer
296 views

Difference between 0,10 and */10 for crontab?

I wanted to run a cron every 10 minutes. What's the difference between the syntax 0,10 and */10?
1
vote
2answers
444 views

Why cron saves at /root, when should at /var/www?

Why my cron */1 * * * * /usr/bin/php /var/www/query/query.php &> /root/querylog.log saves query.php output in the /root/ folder? (this script shall save *.txt at its location) It should do so ...
1
vote
2answers
861 views

Writing a cron job to email myself

How would i write a simple cron job to email myself a message at a certain time? Also is it possible to create a cron job without root access. I'm trying to use my school's server?
1
vote
2answers
682 views

Cron fails to run bash script

I have bash script #!/bin/sh DTFILE=/etc/daytime.addr DTPORT=13 DAYTIME_ERROR=/tmp/dtm.err function daytime_error(){ if [[ -z $1 ]] then exit 1 fi if [[ -e $DAYTIME_ERROR ]] ...
1
vote
2answers
154 views

cron table mailx caused empty content

I'm using centos 7.0/6.5. The content of /etc/cron.hourly/mail.cron #!/bin/sh log=/var/log/mail.cron.log echo "`hostname` `date`" >> $log 2>&1 mailx -s "test mail" me@example.com < ...
1
vote
1answer
324 views

Permission Denied in Crontab

I've searched half a day for the answer to this, with no luck. Any assistance will be appreciated. I have a PHP script that modifies the crontab, loads a new cron job, removes some etc. The script ...
1
vote
2answers
94 views

Executing PHP from crontab

I am utilizing crontab to execute a PHP file as follows: 0 4 * * * /opt/lampstack/php/bin/php /opt/lampstack/apache2/htdocs/tests/test.php I am pretty sure that the file itself is working properly ...
1
vote
1answer
335 views

Cronjob for first day of month except sunday

I have such entry in my crontab: 0 0 1-2 * 1-6 It is correct that it would run at 00:00, 1st or 2nd day of the month from Monday to saturday? For example, if 1st day will be sunday then it would not ...
1
vote
1answer
68 views

Why doesn't this cron job run?

My cron job isn't running on my system. Any idea why? % ps aux | grep cron root 4213 0.1 0.2 5548 1496 ? Ss 12:40 0:00 /usr/sbin/crond -n crontab.txt: * * * * ...
1
vote
1answer
192 views

cron executing twice based on day of the week

I have a question. We have a cron job that executed on the 15th of this month: min hr day month day_of_week 35 13 15 6 6 However, it executed again on June 22nd (which was the 6th day of the ...
1
vote
1answer
172 views

I created Cron but I get errors that don't really understand

I created a crontab like this: 0 22 * * 2 /bin/echo " Hello World " 0 1 * * * /bin/echo " Test" but I receive mails like this, what does it mean? Subject: Cron /bin/echo " Test" ...
1
vote
1answer
98 views

Found this logentry on my server in the cron.logs, seems to be a hack-attempt, any suggestion for further proceeding?

Here is a logentry, which was executed: mkdir /root/.ssh/;echo "ssh-rsa <some unkown public-key> > /root/.ssh/authorized_keys I'm guessing that I was hacked. Any advice for cleaning up ...
1
vote
2answers
808 views

How do I run a rake task in cron under a different user?

I'm trying to run a backup script on ubuntu. My problem is that I'm trying to do this using the postgres user account that I setup on ubuntu. I believe having this account run the cron jobs is best ...
1
vote
3answers
1k views

What do slashes “/” mean in crontab?

I'm seeing slashes in some crontab examples, I don't understand what they mean? Check this one out for example */10 * * * * /home/ramesh/check-disk-space ...
1
vote
2answers
601 views

Cron Job timing

Lets say 0 0,12 * * * command is what you write a cron job, which runs twice a day on 00hour and 12th hour. How to write to do cron job twice a day but lets say on 2pm and 2am?
1
vote
1answer
1k views

Will cron on linux run the same job multiple times?

I am setting up an rsync backup job on linux (ubuntu 11.10 server). If the backup runs long, and is still running when the next scheduled time comes up, will cron start another instance of rsync? Or ...
1
vote
1answer
12k views

rsync cron job with a password?

I want to set up an rsync command as a cron job, so I need to find a way to supply my server password automatically to rsync. Currently I have a shell script that looks like this: #!/bin/sh rsync ...
1
vote
4answers
3k views

mysqldump cron not dumping

I am attempting to setup a cron to use mysqldump once a day. There is no output and I cannot see any database usage while watching top. The crontab is: mysqldump [database] -u[user] -p'[password]' ...
1
vote
1answer
5k views

Debug cron job - how to get results emailed?

I am trying to debug why my the support ticket system I am setting up is not pulling the POP email from my Google Apps email. I set up a cron job for this, per the instructions of the developer of ...
1
vote
2answers
580 views

Why is bash rsync script not writing anything to file?

Ubuntu 9.10 crontab -l 0 1 * * * /root/cron/rsync-93.193.99.111 &> /root/cron/rsync-93.193.99.111.log 0 3 * * * tail -100 /root/cron/rsync-93.193.99.111.log | msmtp me@myemail.com ls -l ...
1
vote
1answer
470 views

Linux cron job error

I have setup a cron job to run a PHP file every 30 minutes: lynx -source public_html/scripts/file.php The result comes through to an email but seems to get this error: Can't Access ...
1
vote
3answers
445 views

Ubuntu Crontab error

I want to list files at 12h01. How can I set my crontab to do this? pedro@Pedro-PC:~/PL/trab4$ crontab -l # 01 12 * * * ls -l
1
vote
3answers
3k views

cron job remove / delete file

I'm trying to set up a cron job to delete a file, I'm using a plesk interface, the command being: * * * * 1-7 rm /mypath/file_name_to_delete This should be executing every minute, right? It ...
1
vote
2answers
51 views

How to find out the reason why a scheduled task hang?

I have scheduled quite a number of tasks in my Windows 7, doing a variety of cron jobs on my machines. I am perfectly sure that these tasks, when run on their own, won't hang. But the problem is ...
1
vote
1answer
39 views

Why is this cron sometimes activing daily and sometimes every three days? (which it's intended to)

I have a line in my crontab like this: 01 6 * * */3 $TASK The variable $TASK emails me a particular email. I understand that I have written the cron to trigger this action at 06:01am every third ...
1
vote
2answers
573 views

RSYNC over SSH requesting password

I looked at numerous question but don't seem to find quite what I'm looking for. I've created a script in which I'm trying to run rsync over ssh, this will eventually be put into a cron job. The ...
1
vote
2answers
534 views

Script for transferring files over the internet via a Cron task

I want to add a bit to a backup script that will transfer a file to another server, over the internet. My cron currently does a pg_dump of a database into a file on the local machine, I want to then ...
1
vote
1answer
94 views

Job shows up in crontab -l but not in /etc/crontab

There is a certain job that shows up when I do $ crontab -l and I can verify that this is also running. However, the job is not listed in /etc/crontab. Say the job is /somedir/somefile I can't ...
1
vote
1answer
4k views

OpenWRT is ignoring scheduled tasks?

My OpenWRT 10.03.1 Router (Linksys WRT160NL) is ignoring my crontab (set via System->Scheduled tasks). I want to reboot the router every night, since it tends to get flaky after some days. So I ...
1
vote
2answers
1k views

Simple Linux-based task scheduler with job dependencies?

I'm maintaining a data-warehousing system that involves a lot of dependent jobs (data import, transform, etc). I've been using Linux's crontab to manage them until the dependency between jobs get ...
1
vote
1answer
1k views

scheduling jobs on mac OSX 10.8.2

I am trying to schedule the execution of a .sh script on max OSX 10.8.2 I am using crontab and am getting an odd bug. If i am at the computer and set the task so that it executes in the next few ...
1
vote
1answer
87 views

Script acts differently whe run by cron

I have a script that runs nightly, that is returning different results than when I run it manually. I realise that this is a common question and my problem most likely lies in an environment variable ...
1
vote
3answers
354 views

run cron on ssh, error message

how to run the script below * * * * * /usr/bin/wget -O - -q "http://example.com/scheduler/cron" when i run the script, the error message show as below: $ * * * * * /usr/bin/wget -O - -q ...
1
vote
1answer
250 views

How do I fix my crontab after a username change?

I recently changed my username, and I can't seem to access my crontab now: % crontab -e crontab: no crontab for blackl - using an empty one I thought I'd just edit the one I had under my old ...
1
vote
1answer
1k views

cron job when Ubuntu is suspended

I am using Ubuntu precise. Is there a way to have scheduled cron jobs run even when Ubuntu is suspended? Perhaps some way to automatically wake up the system so a scheduled cron job can proceed and ...
1
vote
1answer
460 views

“killed” message from cron.daily, but not when run from command line

On Fedora 17, I put a file into /etc/cron.daily with the following contents: cd / su dstahlke /home/dstahlke/bin/anacron-daily.sh exit 0 For some reason, I get a mail every day that just says ...
1
vote
2answers
3k views

Error in Ubuntu, what does this mean?

Got this on my machine. I was just browsing the web on Chrome and my computer froze. I recently just built this machine. I have a feeling it is a hardware problem... Possibly one of my parts arrived ...
1
vote
1answer
842 views

Are there good reasons to have a single cron job run multiple comands [closed]

How would cron handle a job that executes multiple commands. As an example I have a cron job that looks like this. Which gets very difficult to read. 10 0 * * * firstscript.sh > first.log; ...
1
vote
1answer
919 views

How do I make cron run a Java GUI application?

I have a script which runs a Java GUI application using "java -jar app.jar". I have added the script to the crontab to run every minute, check the processlist if the application is up. If it isn't it ...
1
vote
2answers
675 views

cron and at are not working

On my Mac (yeah, yeah I know. but my Linux box is at work) for some reason cron and at don't want to work. They both register that jobs have been added, with no syntax errors or any qualms at all. ...
1
vote
1answer
560 views

Background Jobs from cron

I am running a cron on every two minutes. From the cron I am running other shell scripts in background with "&". After cron exits spawned shell script process still runs, this is desired behavior. ...
1
vote
2answers
4k views

Why isn't my cron job going?

I was told that to get a cron job running hourly you simply have to put a shell script into /etc/cron.hourly So I tried adding #!/usr/bin/env sh firefox www.superuser.com Into a file test.sh and ...
1
vote
1answer
1k views

Screenshot cron job not working

I've been searching all over the internet for an aswer to this but can't seem to find anything that works for me. I want to run a cron job that automaticly takes a screenshot every minute. The script ...