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

learn more… | top users | synonyms

1
vote
2answers
408 views

os.popen returns empty string when called from cron

I'm trying to get my Raspberry Pi's CPU usage like so: def get_cpu_usage(): return os.popen("top -n1 | awk '/Cpu\(s\):/ {print $2}'").readline().strip() When executed normally, this method ...
1
vote
1answer
89 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
2answers
2k 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
211 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
826 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
660 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
102 views

What does everyone have running in their cron?

In cron I run a bunch of regular maintenance stuff on my production server. I was wondering what everyone else runs in theirs. Is there anything novel? Is there anything very basic that noobs ...
1
vote
2answers
42 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
54 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
64 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
158 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
58 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
147 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
137 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
96 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
698 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
2answers
361 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
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
574 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
11k 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
2k 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
564 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
452 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
444 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
26 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
29 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
429 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
81 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
3k 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
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
617 views

git push to github via cron on mac

I'm trying to use git push in a bash script being run by crontab to push a commit to github. At the end of the script I'm doing this: # script processes some files, then: git add -A git commit -a -m ...
1
vote
1answer
80 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
288 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
217 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
908 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
368 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
701 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
2answers
641 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
507 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 ...
1
vote
1answer
313 views

Cron issue with daylight savings time

I have a cron job to send an email once everyday. I actually do not know the issue, but i'm guessing it has something to do with daylight savings time. During DST, my emails are sent one hour late ...
1
vote
1answer
627 views

The perfect cron job as a wake up service

I need a cron job script coded on MAC OS X following the process below: Put the computer into sleep mode on weekdays except Fridays at 10:30 pm. Wake the computer up from sleep, boost the volume to ...
1
vote
1answer
556 views

Help updating cron entry using regular expressions

hi I am trying to update a cron entry NOT by using crontab -e but by shell commands. For example the cron entry is like this: 10 * * * * /home/localuser/foo.sh -b 1 -h 4 > foo_output.sh ...
1
vote
1answer
234 views

Having trouble running a cron job in Unix which generates a dynamic filename for an output data dump

I am trying to schedule a MySQL database dump by using cron but I get an error for some code that I know works when I call directly in Shell. Here is the code that works perfectly well in Shell: ...
1
vote
1answer
46 views

Script not running as cronjob

I got a script which runs in a cronjob as root. The problem is that the addgroup command would output "Command not found" when it gets executed by the script. #!/usr/bin/perl $datei = `ls ...