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

learn more… | top users | synonyms

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 ...
3
votes
3answers
2k views

How to run webcam software only when I am not home (phone is not on the LAN)?

Currently I've got my user cron starting Motion on a timer when I typically leave for work, and then killing it when I typically get home, so I can watch my cat/burglars/etc: 0 9 * * * killall motion ...
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 ...
2
votes
2answers
135 views

easy way to automatically retrieve image for desktop background?

I would like to automatically download and replace an image from the NASA website to use as my desktop. in linux i used a cron job to do this, using wget to retrieve the file and a small utility to ...
3
votes
3answers
3k views

Running mysql dump in a cron job without exposing passwords

I want to run mysqldump -u aUser -p P4SSw0rd --all-databases > backup.sql in a cron job. How can I do so securely? I know I could put the command right there, but anyone with access to the ...
0
votes
1answer
128 views

Cronjob using the mail function

When I run this mail command from the terminal, there's no problems: mail -s "Test Mail" user@example.com < home/user/example.txt When I add it to a bash script that mainly does this, there's no ...
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?
38
votes
3answers
926 views

What is the point of system-autodeath?

In a previous question I found a "system autodeath cron job" which would shut down my default network route daily. As I have never heard of such a thing before, I would like to know what it exactly ...
0
votes
1answer
244 views

Make crontab work at 0 hour

I try to execute some command like this: */10 0,1 * * * $BPY some_script.py Meaning I want to run it every 10 minutes between 0:00 and 1:00. BUT: I see in my /var/log/cron that it is not executed. ...
0
votes
1answer
956 views

How can I save a cron job?

I have connected via ssh and have added a cron job but I can't figure out how to save it. I'm still on the crontab -e page how do I save my changes?
0
votes
0answers
31 views

This weird behaviour from cronjob

I have set the crontab like this: */5 0 * * * /www/permitChat.sh and the /www/permitChat.sh is this: # We are setting the name of file # in the variable along with complete path. sFilePath=`date ...
2
votes
1answer
845 views

Cron jobs are running but there is nothing in crontab? Have I been hacked?

I have a server that's been running for years now and there are no cron jobs set up. I have not logged in or changed anything in months. Suddenly I started receiving emails that look like this, about ...
0
votes
1answer
329 views

Crontab No such file directory

I'm trying to run an hourly python script. My crontab looks like this: crontab -l 0 * * * * "/common/.../www/concat.py /common/.../www" as an output I get this: /bin/sh: /common/.../www/concat.py ...
3
votes
1answer
70 views

What does this crontab line do?

What does this crontab entry do? I'm thinking it means run the jobs.sh script every Monday at 11AM. Is this correct? 0 11 * * MON /home/username/jobs.sh
1
vote
1answer
906 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
3answers
599 views

cron ignoring environment variables?

This should be simple, but it doesn't seem to be working. I have a very simple script run by cron: export MAILTO=foo@foo.com MAILTO=foo@foo.com echo "MAILTO is set to $MAILTO" Cron, however, seems ...
2
votes
3answers
716 views

Cron job outputs HTML; how to send mail as HTML

I have a cron job that if it fails outputs HTML. If it succeeds it outputs nothing, in which case I get no mail. If it does fail and write HTML, cron sends me the mail but it comes as plain text and ...
0
votes
1answer
90 views

Crontab as other user

I am running crontab as root user: screen -S konsola -X stuff 'say hello'`echo -ne '\015'` How do I run it as the user "nobody"? Only this user has screen with given pid, thats why I need it.
3
votes
1answer
2k views

Two parts: linux startup script to connect to bluetooth and cron to keep it connected

I have a mini bluetooth keyboard and a Raspberry Pi running a Debian-based distro. I know the MAC address of the keyboard but for this question, let's just use AA:BB:CC:DD:EE:FF. Right now I have to ...
0
votes
1answer
552 views

Ubuntu Precise cron.daily issue

I have a very strange problem. I've placed a script into /etc/cron.daily on my Ubuntu 12.04 server, gave it the appropriate permissions (0755), and assumed it would run correctly. I guess that was too ...
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
1answer
437 views

Run Cron every 2 minutes in 30 minutes?

I need to run a cron job every 2 minutes (*/2) but only for the first 30 minutes of every hour, with pause of 30 minutes between the runs. For example, something like: From 10h00 to 10h30: run ...
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
2answers
515 views

Backups over SSH via Cron - which user?

I'd like to use rsync to regularly backup content from a production website to a backup server. The content being transferred from the remote system has a variety of permissions and owners assigned. ...
1
vote
1answer
700 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
160 views

crontable OR conditions

Crontable parameters seem to function as 'ands' conditions. So the example 0 9-5 * * 1-5 Runs when the conditions are met "minute is zero AND hour is between 9 and 5 AND day is between monday and ...
0
votes
0answers
142 views

Will my weekly cron job work?

I'm just getting back into bash scripting and I want my cron job to run every 15 minutes between 9.15 and 10 PM. I've checked the script works, but I don't know if it's the right command: ...
3
votes
2answers
3k views

ssh Permission denied only in cron job

Having a very strange problem. I've created a small bash script which runs a command on a remote host via ssh (using public key authentication). When I run this script manually from the command line ...
4
votes
2answers
623 views

Auto suspend after X minutes to stop myself procrastinating

Right now, I'm using a line in /etc/crontab to run pm-suspend every 30 minutes, but I would like an application displaying a warning before suspending (for example a countdown in the taskbar). An ...
0
votes
2answers
376 views

SShfs and security

I have following questions: If I mounting sshf mail@host:/home/mail ./foo Is it any way to restrict possibilities of mounting and to not give shell access? All I want is remote, secure storage for ...
2
votes
4answers
3k views

how do i run a script 5mn after startup?

I have severals RoR websites running on my webserver and I need to run a ruby script at startup. So, I puted a bash script in /etc/init.d witch call a ruby process. Unfortunatly that ruby process ...
1
vote
2answers
4k views

crontab - /bin/sh: wget: command not found

I want to set up a crontab on my Macbook Pro running Lion. I run the usual crontab -e and provide a quick job to see if everything is working ok --- */10 * * * * wget -O - -q -t 1 ...
0
votes
2answers
409 views

Windows app to grab webcam snapshots?

I want to periodically capture an image from a webcam attached to a Windows PC, and upload it to a Linux server on the network (preferably FTP, could be SFTP or even Samba). The images have to be ...
1
vote
0answers
402 views

“ssh_exchange_identification: Connection closed by remote host lost connection” when running cron job

I have a Ruby script that connects to a remote machine via ssh and executes a command. The script runs fine when I just run it in my terminal. In my crontab, I have 1 * * * * /bin/bash -l -c 'ruby ...
0
votes
1answer
362 views

Cron job for moving directories older than 24 hours

Well, what I want to do is The cron should run every hour or so It should move the directories in a folder /disk1/data/ older than 24 hours to /disk2/data/ The directories moved should contain all ...
0
votes
1answer
461 views

Is it possible to add directories under cron.d?

I wanted to partition a single cron file into separate logical units and place them in subdirectories. One folder under cron.d would have all crons associated with say, removing certain types of ...
1
vote
0answers
401 views

Inconsistencies with SCP for Ubuntu and Windows Server 2003 (using CygWin 1.7.x.x)

Some days ago I was able to scp to the remote server from my windows server 2003 using cygwin to copy the id_rsa, using scp (id_rsa.pub location) user@example.com now it(scp) seems to be not working. ...
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
1answer
234 views

What might cause cron jobs to occasionally not run or complete?

In my crontab, I have set MAILTO and a bunch of cron jobs (5-10 jobs). These cron jobs usually run fine and I get emails for them. Most of these jobs consistently run as expected. Emails and ...
3
votes
1answer
12k views

Why is my crontab not running

I have this cron 38 * * * * /bin/bash -l -c 'cd /var/rails/site/releases/20120705144335 && script/rails runner -e qa '\''Play.load_lists'\''' I have this cron under the a different user so ...
2
votes
2answers
137 views

Cron Job that restarts crashed game

So I'm hosting a game that is very tempermental and can crash a lot on Linux, I made this cronjob to restart the screen and game should it fail: #!/bin/bash for t in {1..12} do if [ -z "$(ps -C ...
2
votes
2answers
726 views

crontab -e fails to start

whenever I try to run crontab -e I'm getting errors such as: no crontab for banana - using an empty one /tmp/crontab.oeFm1e: Invalid argument Is there any way to edit / install the file?
0
votes
0answers
33 views

Run checkgmail as a cron job [duplicate]

Possible Duplicate: How do I make cron run a Java GUI application? I use checkgmail at work constantly, but this application has a memory leak, and after a week (I never shut down my work ...
2
votes
1answer
489 views

Schedule bash script for one time use on OSX

I'm trying to do a little script that, as a function, will take a file and date as input and delete that file on the specified date. So I only need it to schedule to run once, and that's it. I'm on ...
0
votes
1answer
2k views

How to delete directories older than one hour (cron job)

My application creates directories when user performs certain action. These directories are stored on my machine for exactly one hour and than are deleted. Now I would like to move the 'deleting ...
0
votes
1answer
102 views

In OS X Lion under zsh, how can I set up a /Users/username/tmp directory which deletes after X days?

I'm new to scripting and regular jobs on OS X, so appreciate the help in advance. I'm looking to have a tmp directory in my homedir, as in /Users/username/tmp which I can use as my "downloads" ...
4
votes
1answer
2k views

Is there a aliases file for sSMTP?

I installed sSMTP for sending emails from command line. I want to create some alias for cron jobs: $ sudo vim /etc/aliases # append this line at the end myname: root $ newaliases ...
6
votes
5answers
5k views

Run a cron job on the first Monday of every month?

I'd like to run a job from cron at 8.30 on the first Monday of every month. The cron Wikipedia page says While normally the job is executed when the time/date specification fields all match ...
3
votes
1answer
8k views

How to use @reboot for crontab with delay

In crontab, I can use @reboot to run a command after the system reboot. Is there a way to do this with an delay, i.e. run a command after 10 minutes of reboot?
-1
votes
2answers
416 views

cron uid:gui for every username

So in the nutshell : There was user John with 502:502. After i deleted John and recreated him, his UID:GID changed to 504:504. Cronjobs are still running under the John's crontab, but when the ...