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

learn more… | top users | synonyms

1
vote
2answers
786 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
643 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
101 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
1answer
31 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
49 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
120 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
51 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
130 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
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
625 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
343 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
556 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
4k 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
558 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
440 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
443 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
1answer
23 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
343 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
69 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
2k 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
559 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
70 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
255 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
213 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
826 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
325 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
2k 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
585 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
622 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
476 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
978 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
307 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
621 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
529 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
233 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
34 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 ...
1
vote
1answer
135 views

Tracking down edits to my /etc/hosts file

Every hour at :49, my hosts file is being replaced with the following: # Copyright (c) 1993-1999 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file ...
1
vote
2answers
38 views

Automated apt-get upgrade quits midway

I set root's cron to automatically run apt-get upgrade. Easy enough. Here's the specific line: @daily (apt-get update && apt-get -y upgrade) 2>&1 > /var/log/tmp.log However, I've ...
1
vote
1answer
81 views

How can I run a Cygwin command (not a Windows native command) as privileged?

If I open a (elevated via UAC) Bash Shell in CygWin: Luis@Kenobi /cygdrive/c/Windows/system32 $ crontab.exe -l -u Luisito must be privileged to use -u Tested on WinXP-SP3 and Win7-SP1. Same results ...
1
vote
1answer
210 views

Ubuntu start Node.js server and open Chrome in kiosk mode

I'd like for a computer to immediately start a Node.js application on boot. I'd then like Chrome to open in Kiosk mode, but only after the server has been started. Looking on the Ubuntu Stack ...
1
vote
1answer
112 views

How can I conditionally start a service based on the current local time using Mint Linux 15?

I have set up cron jobs which stop services at 2:00 AM and then restarts them at 8:00 AM. However, my enterprising users (my family; securing the box isn't a possibility) have determined that if they ...
1
vote
1answer
46 views

Directory permission with crontab

I have a directory my_website/public, which I did chmod 777 on. I set up a cronjob to delete all the files in my_website/public/photos/* But I got an email notification saying that rm does not have ...
1
vote
1answer
123 views

Why echo $(crontab -l) outputs current working directory listing and only then the content of crontab file itself?

So if cwd is the /tmp now: crontab -l > #min hour day mon dow command > * * * * * /usr/local/bin/growlnotify -t 'helloTitle' -m 'helloMessage' -n 'myApp' -sw but: echo $(crontab -l) > ...