Crontab is a short form of cron table. It is a configuration file that specifies shell commands to run periodically on a given schedule.

learn more… | top users | synonyms

0
votes
0answers
65 views

Crontab not wroking

I have created a script in Ubuntu. Here is the script: #!/bin/sh DISK_SPACE=`df -k | grep sda1 | awk '{print $5}' | sed '$s/%$//'` DISK_SPACE_LIMIT="58" if [ $DISK_SPACE -gt $DISK_SPACE_LIMIT ] ...
1
vote
1answer
194 views

Why crontab command is not available to me even I am root

I am using the CentOS release 6.3 (Final). My problem is that even I have logged in as a root to my centos server through ssh crontab command is not available to me . I got the following when ever ...
0
votes
1answer
41 views

two crons not running simultaniously? [duplicate]

MAILTO="" */10 * * * * /bin/bash /var/www/sym_monitor/sym_start.sh > /var/www/migrate/root_start.txt 2>&1 */10 * * * * /bin/bash /var/www/sym_monitor/stop.sh > ...
0
votes
0answers
12 views

shell script not running the other script inside it [duplicate]

#!/bin/bash value=$(</var/www/sym_monitor/man.txt) if [ "$value" == "true" ]; then ps -ef|grep sym |grep -v grep |awk '{ print $2 }'|sudo xargs kill -9; cd /var/www/symmetric-ds-3.1.6/bin; ...
2
votes
0answers
80 views

Mac Crontab Deleted

I was messing around with creating cron jobs and somehow I wound up deleting crontab out of /usr/bin. Does anyone know of a way that I can recover it without having to re-install multiple components ...
2
votes
1answer
356 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
65 views

Long-lasting command in crontab

I want to put execution of my script in crontab every 1 hour. I wrote script that record stream using streamripper. Duration of each stream will be 7 minutes. Is it safe to put this in crontab? Maybe ...
0
votes
2answers
940 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
0answers
330 views

Issue in running cron jobs in RHEL5

When I try to run cron jobs from root, I am getting the following error. I am using RHEL5. Can anyone help me? [root@localhost]# crontab -e Permission denied You (root) are not allowed to ...
4
votes
1answer
567 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 ...
0
votes
3answers
647 views

Shell script works directly, but has a syntax error via crontab

I have a shell script to automate a git commit and push every night: auto_git_push.sh #!/bin/sh function automate(){ git add . git commit -am "automated push $(date +"%Y-%m-%d")" git ...
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) ...
-4
votes
1answer
77 views

Schedule a cronjob start everyday automatically [duplicate]

Possible Duplicate: Is there a way to have Linux run a command every X minutes? I want to run a command which will be synchronize my remote folder data to my local computer. command is sync ...
0
votes
1answer
3k 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 ...
2
votes
1answer
3k views

Linux - check when crontab file was last amended

How can i get the last updated date/time of the crontab file. not when cron was last run but instead when was the crontab file amended last
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
102 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 ...
2
votes
1answer
550 views

Set default editor for crontab -e invoked with sudo

I'm using Bash on Debian Squeeze. I just read this topic: change default text editor for crontab to vim I have exported both variables VISUAL and EDITOR to vim for normal user and for root. And this ...
1
vote
3answers
338 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
106 views

crontab script don't execute if console is closed

I'm using Debian 6.0.6. I edited root crontab a few days ago to add this line: 00,10,20,30,40,50 * * * * /root/Scripts/con_switch6.sh >> /var/log/con_switch_diario.log 2>&1 I'm ...
0
votes
1answer
575 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 ...
0
votes
2answers
649 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 ...
0
votes
1answer
261 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 ...
0
votes
1answer
2k views

Why is this cron not working?

I've made a script that backs some files up and puts them in a folder, When I do sudo /data/backups/scripts/nightlybackups.sh It works, I just want to make it a cron job so that it runs every ...
1
vote
1answer
248 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?
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 ...
3
votes
1answer
2k views

How do I make crontab generate a unique log each time it runs a job?

Here is the crontab job /usr/local/bin/python2.7 /home/scripts/script.py >> /home/scripts/logs/log.log 2>&1 How do I generate a new log every time the job is run? I am cool with ...
0
votes
1answer
92 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.
1
vote
1answer
792 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
98 views

crontabs hour specification */1 is that the same as *

I am looking for clarification with the cron tab that I am working with. some job 1 * * * * some job 1 */1 * * * Are those jobs the same? The job will run the first minute every ...
0
votes
1answer
397 views

Is there a way to predict the next execution time for a crontab job?

I'm configuring crontab jobs on an Ubuntu server and I'm trying to figure out how can I predict the next execution time for my jobs individually. It's just a matter of making sure I configured the ...
0
votes
3answers
2k views

Load login shell inside user cronjob

I'm trying to run a rake task using a scheduled cronjob. My crontab looks something like this: 0 1 * * 1-7 /bin/bash -l -c "cd ~/jobs/rake && rake reports:create >> ...
0
votes
1answer
389 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
693 views

Mac OSX 10.6 Cron Job Not Running

I tried setting up a crontab on my Mac, but it's not running for some reason. Here's what I'm trying to run: */2 * * * * /BackupScript/backup.sh I have it set to every 2 minutes currently for ...
1
vote
2answers
400 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 ...
6
votes
5answers
6k 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 ...
1
vote
1answer
822 views

sudo access to view/edit a crontab

I wish to be able to edit, or at least view, a crontab that is on a server. Should I not be able to run this to do so: sudo crontab -u root When I do, I get this error: Sorry, user crmpicco is ...
5
votes
2answers
411 views

Crontab Error Emails: Set Sender to Root Using -f

For a crontab entry in this format, */1 * * * * /usr/bin/php /app/<userid>/command --flag='value' I see this message emailed to <userid>@host (and view via mail) at one per minute: ...
0
votes
2answers
2k views

Issue pushing file from linux to windows with smbclient

I have a file located on my linux box that is generated by a python script, the file is dropped inside of the /root/ directory My bash script looks like so: #!/bin/bash # Run the HR Data feed cd ...
1
vote
1answer
880 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
0answers
908 views

Why does cron task run twice?

I have a task that should run each day in Ubuntu10.04. So I use crontab and copy the scripts of the task to the directory /etc/cron.daily. Here is the my crontab: # /etc/crontab: system-wide crontab ...
1
vote
0answers
294 views

What happens if cron.daily is not terminating

Today I had to realize that some cron jobs werent run on my server! In the log files I find this: Mar 13 03:30:01 osp-server anacron[7261]: Anacron 2.3 started on 2012-03-13 Mar 13 03:30:01 ...
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 ...
0
votes
3answers
1k views

Simple Cron task in Mac OS X Lion

I am trying the Cron facility in Mac OS X Lion, but it does't seem to work. The crontab looks like this: MacBook-Air-de-Vincent:run vincentle$ crontab -l MAILTO=bxxxxxxxx@gxxx.com * * * * * (echo ...
3
votes
2answers
2k views

Multiple crontabs for one user

is there a way to use multiple crontab files for one user? Thinking something along the lines of crontab file per project instead of crontab per user... Any help is appreciated...
0
votes
2answers
1k views

How to recover crontab jobs from filesystem

On my system I have fedora 13, which I can't get to boot right now. I'm now running ubuntu 11.10 from a different partition. From ubuntu I can read the fedora partition. In fedora I had some cron ...
2
votes
5answers
235 views

randomised cron command

I'd like to write a cron command so that a job would execute once at some random time during the week - is this possible without having the crontab modify itself? I've considered writing a function ...
0
votes
1answer
64 views

I can not find specific cron running at *:21 and *:56 on Debian

I am frustrated. I have two mystic crons running on our server, that I can not find by doing crontab -l. The good thing is these crons are sending mails. That is how I know those are running at :21m ...
0
votes
0answers
150 views

Crontab crash when running a script that insert a lot of lines in MySQL

My crontab is crashing when I run a script that insert alot of lines on MySQL Database, but when I run a script that inser few lines it run properly, is there some configuration file of cron? Maybe ...
0
votes
4answers
3k views

Disable cron jobs for a specific user

I have a list of jobs in the crontabs for user1, user2. I want to prevent the jobs of user2 from running. I tried listing user2 in cron.deny, but that only prevents him from accessing his crontab. ...