Crontab is a short form of cron table. It is a configuration file that specifies shell commands to run periodically on a given schedule.
0
votes
1answer
18 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 ...
0
votes
1answer
18 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)
> ...
0
votes
1answer
16 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 > ...
0
votes
1answer
21 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 * ...
1
vote
3answers
110 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 ...
1
vote
1answer
93 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 ...
0
votes
1answer
22 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.
...
2
votes
1answer
37 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 ...
1
vote
2answers
109 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 ...
0
votes
0answers
27 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
55 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 ...
5
votes
1answer
175 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
1answer
36 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
1answer
52 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
28 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
72 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
126 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 ...
3
votes
1answer
85 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
71 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
4answers
112 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) ...
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 ...
4
votes
5answers
28k views
How to execute shell script via crontab?
I have a notify.sh script that looks like:
notify-send "hi welcome"
My crontab notification for 2 PM:
0 14 * * * home/hacks/notify.sh
However, this doesn't work. What is the problem?
-4
votes
1answer
53 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 ...
4
votes
3answers
2k 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
...
0
votes
1answer
476 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 ...
0
votes
1answer
58 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
0
votes
1answer
45 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
3answers
205 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
1answer
47 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
108 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 ...
4
votes
2answers
631 views
Can Ubuntu play a video via cron job?
I'm developing a display system for a paint shop.
I've set up a computer with Ubuntu to run the video and display it on a TV, running a PHP script that should update the video every hour via the ...
0
votes
2answers
140 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
106 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
177 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
66 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
24 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 ...
0
votes
1answer
66 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
180 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
0answers
97 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 ...
1
vote
1answer
157 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
60 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
84 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 ...
2
votes
5answers
162 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
3answers
465 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
183 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 ...
1
vote
2answers
696 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
1answer
339 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
179 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 ...
18
votes
7answers
23k views
Run a command every week with Cron?
Simple question- what would a crontab entry look like for a command I want to run every week on Saturday at 8:05 AM?




