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

learn more… | top users | synonyms

3
votes
1answer
773 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 ...
0
votes
1answer
213 views

How to execute a php file when a cron job is created

I want one of my PHP file to be executed when the cron job is executed. I want to do this for updating the database of every users. It is a Banking application project and I need to update every ...
0
votes
1answer
392 views

Schedule/cron MS Outlook to run rules

I have a ton of rules configured for my MS Outlook account. However, I'd like to create a "Cleanup Rule" that deletes messages in various folders. I'd like this rule to run every day at a certain ...
0
votes
1answer
614 views

What time does cron.monthly jobs run in SLES?

doc says cron.monthly will be scheduled according to the first run time and it compares /var/spool/cron/lastrun/cron.monthly with current time to run. Question is will it run according to the ...
1
vote
2answers
89 views

SSH: Dismiss read mail messages from Cron

Whenever I ssh to my server box, I get 'You have mail' along with banner message. Then I type mail, and go through msgs, by hitting enter, until At EOF shows up, and when I do quit or ctrl+d, and ...
2
votes
1answer
550 views

If I schedule a cron job to run at midnight, will it run at the start or end of the day?

If I schedule a cron job to run at midnight on a specific day, will the job run at the beginning of the day, or at the end of the day? For example: # Runs at midnight on 20th February: 0 0 20 2 *
0
votes
1answer
203 views

How do I run a shell script with export command in crontab?

I have a shell script that exports values of variables when executed. The same values will be used in another script. #!/bin/sh export I="10" echo $I I will be using root access for cron. I ...
0
votes
3answers
3k views

“/usr/bin/env bash” is not found when running from a cron script

I have this in my crontab: PATH=/usr/bin:/usr/local/bin:$PATH */1 * * * * /usr/bin/env bash > ~/cron.log 2>&1 The ouput in cron.log is the following: /usr/bin/env bash: No such file or ...
0
votes
2answers
263 views

crontab not working properly

When I run a script manually using root it is working fine. when I execute the same script inside cron it is not running. I checked the cron is actually calling the script but the script is not ...
0
votes
2answers
1k views

Execute a root command every 24 hours after startup

I want to execute a command as root on an Ubuntu 11.04 machine every 24 hours. This machine is not on all of the time, but when it is, it can be left on for days at a time. How should I correctly ...
0
votes
4answers
656 views

How to run the shell script periodically without using Crontab?

I do not have previlage to use crontab -e to run my script. Is there other way to periodically run my script? Basically I need to run it once a week.
2
votes
1answer
47 views

Crontab mis-entered time

I have a crontab that performs a massive operation that needs to run once every five hours #min hour mday month wday user command * */5 * * * ...
4
votes
1answer
658 views

system-wide crontab vs. user crontab to shutdown pc

I'm trying to shutdwon my pc at 2 am once a week. If I use the user crontab of root (sudo crontab -e) 30 2 * * 3 shutdown -h now the shutdown will not be performed. However, if I place the same ...
2
votes
5answers
1k views

rsync works fine until I put it in crontab (UPDATE: 'date' doesn't work in crontab)

I've got this rsync command that works just fine when I run it from the command line (Ubuntu Server 12.04.1 LTS). I'd like it to run every hour, on the hour, and output the results (along with errors) ...
2
votes
2answers
84 views

How to find rpm binary of a given process?

Here is the problem: I'm trying to find what cron software is running on my machine, however question applies to any generic process. One way to do it is: Find the process ps aux |grep cron Find ...
0
votes
1answer
67 views

How does scheduling work?

How do programs designed for scheduling (e.g. Task Scheduler in Windows, cron in Unix systems) know that it "is time" for them to run a certain scheduled command or script? I imagine it's not ...
2
votes
1answer
214 views

Schedule a cronjob everytime it is done

I have a cronjon which runs every 48 hours. But ideally what I want is that it must start running as soon as it stops. Can this be done? It is an sh script consisting of a python command. I am using ...
2
votes
1answer
1k views

Nice commands in a .sh script for cron jobs

I have this php script that I need to run on shared webhosting. I have created a cron job that executes an sh script. The command for the cron was: /bin/sh /home/user/script.sh So I'm assuming it is ...
0
votes
1answer
4k views

Python script not running as cronjob

I have tried everything and I've seen other questions here regarding this but I cannot for the life of me run a python script as a cronjob. I've tried the following. * * * * * /usr/bin/python ...
3
votes
2answers
433 views

find any script which is running for more than say 30 minutes in Linux System

Please share command to find any script which is running for more than say 30 minutes. in Linux System
1
vote
3answers
2k views

Why does this crontab file only run once?

I have the following crontab file: 2 * * * * /bin/date >> /home/jon/date_from_cron.txt I think this means "run every two minutes". However, it only runs once. Shortly after setting up this ...
0
votes
2answers
109 views

crontab email is not working as expected. First I got the emails at gmail, now I'm not getting them

First I ran a simple test to see if I could get crontab to send me an email. I created the following line: MAILTO = my_email_address@example.com 1 * * * * /bin/echo "foobar" This worked as expected ...
1
vote
1answer
98 views

python, cron and the interaction with Growl

I have the following python file called temp.py import subprocess p = subprocess.Popen('growlnotify -m \"Program is not running\"', shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) ...
1
vote
3answers
396 views

cannot access crontab with sudo after being added to /etc/sudoers list

My user "craig" is in the /etc/sudoers file on my CentOS 5.6 VM, however when I try to access the crontab using the command below I am presented with an error message: sudo crontab -e -u ...
0
votes
1answer
696 views

Crontab is using some sort of hidden cache?

I used to have a crontab that ran like this * * * * * /usr/bin/php /var/www/vhosts/default/htdocs/agent/time_keeper.php > /dev/null 2>&1 It worked fine. Now I moved that php script to a ...
1
vote
1answer
94 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
2answers
845 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 ...
0
votes
1answer
277 views

Cronjob does not work

I tried to set up a cronjob on my server. Actually this command should execute a java programm every hour. But somehow this didn't worked. I googled and tried to set up a test-script that should run ...
0
votes
2answers
855 views

Error setting up Crontab

Trying to set up a cronjob: 0 12 * * * /usr/bin/mysqldump --all-databases > /backups/mysql/`date "+%Y-%m-%d"`.sql Getting error: crontab: installing new crontab "/tmp/crontab.fuly8s":2: bad ...
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
0
votes
1answer
278 views

Why is this CRON failing to execute?

$ crontab -l # # m h dom mon dow command SHELL=/bin/bash * * * * * (/usr/bin/curl -s -XPOST http://internal.ip -H 'Content-type: application/json' -d 'data') $ ls -l /usr/bin/curl -rwxr-xr-x 1 ...
2
votes
1answer
449 views

How do I ensure a process is running, even if it kills itself? (it needs to be restarted then)

I'm using linux. I want a process (an irc bot) to run every time I start the computer. But I've got a problem: The network is bad and it disconnects often, so I need to manually restart the bot a few ...
2
votes
1answer
668 views

Make shell script commands to abort after certain timeout

I have often a situation in Linux shell scripts that if a specific command takes too long to run e.g. due to a network problem the shell script should abort running this command. What best practices ...
1
vote
0answers
99 views

script executing perfectly in terminal but not in cron

I setup a script for to take an mysql db backup everyday on a specific time, so now the cron is running perfectly it executing the script without problem but the problem is db backup file is not ...
2
votes
2answers
254 views

Automatically commit a file to git

Is there a way to easily commit a file to git if it has updated? I want to take a list of files in a directory, write it to a text file, and commit it to git if it's changed. I assume this would ...
1
vote
1answer
289 views

why can't I start a program directly from cron?

I'm currently setting up a raspberry pi running Debian wheezy as an IRC server. It runs two programs as a regular user on boot - ngircd and atheme. ngircd and atheme both log to /var/log/syslog ...
1
vote
2answers
137 views

Rsync to take the newest file. And a cron job?

I have a log file on two different servers. The servers are under a load balancer so half the traffic goes to one server, and half the traffic goes to the other server. I need to take the newest log ...
1
vote
3answers
378 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
3k 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
266 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
139 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 ...
5
votes
3answers
5k 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
141 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
358 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?
39
votes
3answers
944 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
391 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
2k 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
33 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
1k 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
368 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 ...