Questions tagged [crontab]

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

Filter by
Sorted by
Tagged with
2 votes
1 answer
132 views

crontab schedule rule misunderstanding

I've got some strange behavior of one rule working unexpected. */40 * * * * myshellcommand here I though it would run each 40 minutes, e.g. 00.00 00.40 01.20 02.00 etc but instead it runs 00.00 ...
heximal's user avatar
  • 175
0 votes
3 answers
226 views

OsX Crontab having no effect

I am dynamically appending cron tasks to the user crontab The tasks seem to be getting adde, crontab -e looks like: */10 * * * * /bin/sh /Users/john/Kiosk/app/content/update.sh @reboot /usr/bin/open ...
Mild Fuzz's user avatar
  • 743
1 vote
1 answer
284 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 seem ...
highBandWidth's user avatar
2 votes
1 answer
967 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" Content-Type:...
user229366's user avatar
1 vote
2 answers
2k views

Linux - switch to "cron" user

Sometimes i have issues with cron jobs not running, and diagnosing why can be difficult. What would be useful is to switch to the same user as the cron jobs run under, so i can see if there's a ...
Max Williams's user avatar
  • 2,989
0 votes
1 answer
2k views

Why the command substitution in the crontab job doesn't work?

crontab -l: * * * * * /Users/michel/Desktop/myScript.sh myScript.sh: #!/bin/bash /usr/local/bin/growlnotify -t 'Fact' -m "$(/Users/michel/Desktop/anotherScript.sh data.txt)" -n 'myApp' it doesn't ...
static's user avatar
  • 1,357
1 vote
2 answers
620 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) > #...
static's user avatar
  • 1,357
0 votes
1 answer
460 views

Setup Crontab to work with Cucumber

I'm trying to setup crontab to work with cucumber. So far, I were able to get crontab to execute a ruby command, but not a cucumber command. This is what I have in crontab: ~/test.sh > ~/out.log 2> ...
user222776's user avatar
0 votes
1 answer
382 views

crontab setup on Mac

I'm trying to setup a crontab on the Mac. It just simply prints the message "Hello there!" to the console at a specific time, but it doesn't seem to work. Below is what I have in the crontab: 28 16 * ...
user222776's user avatar
9 votes
4 answers
38k views

Running Cronjobs as per Local Time rather than Universal Time

On running dpkg-reconfigure tzdata in terminal and i get 2 different time on my machine Local time is now: Wed May 1 11:58:55 IST 2013. Universal Time is now: Wed May 1 06:28:55 UTC 2013. ...
user avatar
4 votes
3 answers
6k views

I want to run an rsync command at midnight but make it stop at 8am. How can i schedule the start AND END of a command?

I want to run an rsync command at midnight but make it stop at 8am. How can i schedule the start AND END of a command? I've looked into cronjobs but that will only start at a certain time. Any ideas ...
user avatar
2 votes
1 answer
4k 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 ...
neotam's user avatar
  • 123
0 votes
1 answer
58 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 > /var/www/migrate/...
user1597811's user avatar
1 vote
0 answers
224 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 ...
user202029's user avatar
3 votes
1 answer
3k 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 *
Steve HHH's user avatar
  • 7,100
0 votes
1 answer
171 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 ...
Coolmax's user avatar
  • 61
1 vote
2 answers
4k 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 ...
Matthew G's user avatar
  • 183
0 votes
0 answers
618 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 ...
Amal G Jose's user avatar
4 votes
1 answer
1k 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 ...
Philippe's user avatar
  • 937
1 vote
3 answers
7k 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 ...
hookedonwinter's user avatar
4 votes
5 answers
5k 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) ...
Jeremy Swinarton's user avatar
-5 votes
1 answer
491 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 -ave '...
Anonymous Anurag's user avatar
1 vote
1 answer
11k 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 /home/...
KingKongFrog's user avatar
11 votes
1 answer
33k 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
user avatar
2 votes
3 answers
9k 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 ...
tadasajon's user avatar
  • 317
0 votes
2 answers
212 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 = [email protected] 1 * * * * /bin/echo "foobar" This worked as expected ...
tadasajon's user avatar
  • 317
6 votes
2 answers
5k 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 ...
Coolmax's user avatar
  • 61
1 vote
3 answers
1k 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 crmpicco-...
crmpicco's user avatar
  • 315
0 votes
1 answer
226 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 ...
user avatar
2 votes
1 answer
4k 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 ...
user avatar
1 vote
2 answers
12k 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 day-...
William Orazi's user avatar
0 votes
1 answer
662 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 ...
user124114's user avatar
1 vote
1 answer
4k 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 ...
user893730's user avatar
  • 1,217
1 vote
1 answer
6k 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?
user784637's user avatar
  • 2,015
0 votes
0 answers
52 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 +\/...
hjpotter92's user avatar
7 votes
1 answer
8k 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 adding ...
masterial's user avatar
  • 173
0 votes
1 answer
363 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.
Szymon Toda's user avatar
  • 1,639
1 vote
1 answer
2k 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; ...
nelaaro's user avatar
  • 13.6k
3 votes
1 answer
2k 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 ...
nelaaro's user avatar
  • 13.6k
0 votes
1 answer
3k 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 ...
Muhammad Gelbana's user avatar
0 votes
3 answers
7k 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 >> ~/jobs/logs/cron.log"...
sa125's user avatar
  • 996
0 votes
2 answers
1k 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 ...
yashau's user avatar
  • 1
3 votes
1 answer
7k 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 ...
Erickj92's user avatar
  • 216
1 vote
2 answers
1k 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 ...
Szymon Toda's user avatar
  • 1,639
59 votes
19 answers
129k 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 ...
Max Williams's user avatar
  • 2,989
1 vote
1 answer
3k 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 ...
crmpicco's user avatar
  • 315
6 votes
2 answers
2k 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: ...
KM.'s user avatar
  • 161
2 votes
2 answers
4k 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 /...
Mike McMahon's user avatar
1 vote
2 answers
3k 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 ...
nanoman's user avatar
  • 111
1 vote
0 answers
2k 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 ...
flypen's user avatar
  • 307

1
3 4
5
6 7