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.
320
questions
0
votes
1
answer
3k
views
Why are some of my cron jobs not sending emails?
To send emails, I use the standard configuration with:
MAILTO="[email protected]"
Here is the content of my crontab:
00 3 * * 2 echo "Internal Backup (mysql) has started!" && tar -zvcf /...
1
vote
1
answer
3k
views
cannot rsync via ssh from crontab
I'm having issues transferring files with rsync via ssh.
If I just run
rsync -avz [email protected]:/home/devel/ $/home/user/rsync/servidor
it works as expected since the public key is stored in the ...
0
votes
1
answer
899
views
Incron Job is not being executed
I am using incron to monitor one of my file in /var/www/html directory.
output of incrontab -l
/var/www/html/test IN_ACCESS /home/intel/test.sh
This job is supposed to create a file in home ...
0
votes
1
answer
150
views
Check for screen using crontab
Currently, I'm using Debian with the following cronjob for screen at reboot:
@reboot screen -dmS app1 /home/app1
@reboot screen -dmS app2 /home/app2
The problem is, that sometimes the application ...
0
votes
2
answers
79
views
Is there any limitation on file names under Unix?
We are using crontab to schedule jobs and it was not picking the files for processing that contain [ or ] or ¿.
Is there any limitation on file names or do these characters mean something in UNIX?
...
1
vote
0
answers
250
views
Why isn't crontab working for me? (Ubuntu 11.04)
I can't get the crontab jobs running. I've checked /var/log/syslog and the scheduled jobs aren't there. I've edited the jobs with
sudo crontab -e
so they are created for root.
This is how my jobs ...
3
votes
1
answer
730
views
Crontab cannot find program installed in local user's bin dir
I am trying to run a bash script on a dreamhost account that does some backup operations. The program I use to do the backup is installed in the home directory of the web hosting account under ~/usr/...
1
vote
1
answer
2k
views
Background Jobs from cron
I am running a cron on every two minutes. From the cron I am running other shell scripts in background with "&". After cron exits spawned shell script process still runs, this is desired behavior. ...
2
votes
2
answers
280
views
How can I change the directory a command thinks it is running in?
How can I run a command that is in a different directory so that the command thinks I've ran it in the current directory?
If a command is using basename() or argv[0] (or whatever it's called) to get ...
0
votes
1
answer
117
views
How to execute a Linux Cron Job from day x to y on crontab?
I found that I can use an hour range by using a slash, for instance, 4-20 to run from 4AM until 8PM.
But what about day range? Can I use something like:
* * 5-20 * * CMD
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 ...
2
votes
0
answers
128
views
Performance loss when having too many files in /etc/cron.d?
Is there an amount of files in /etc/cron.d that would lead to worse performance?
There are currently about 50 jobs in. In the future there can be up to 200 files in.
Am I correct to expect the cron ...
1
vote
1
answer
548
views
setting gvim as editor for crontab
I've see many post saying that by setting the following evnironment variable
EDITOR=vim
or
VISUAL=vim
will allow to use vim as code editor for crontab.
I would likt to try to use gvim instead of ...
19
votes
1
answer
13k
views
crontab and binaries in /usr/local/bin
I am working in Redhat and have few programs located in folder /usr/local/bin I would like to call from crontab for root user.
I thought that by putting binaries in that folder would be sufficient to ...
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 ...
1
vote
0
answers
769
views
How can I run a cron job from PM to AM? [duplicate]
I want to execute a script once an hour from 20:00 to 08:00. Would the following work?
0 20-8 * * * location_of_script_to_run
I'm currently using the following:
0 20,21,22,23,0,1,2,3,4,5,6,7,8 * * *...
0
votes
1
answer
2k
views
How can I set the terminal encoding when running a crontab job?
I have a crontab job which executes a Ruby script on Arch Linux. It works basically, but when I call "googlecl" to post to my blog, it always shows a "safeDecodeError" exception (eg.: googlecl....
1
vote
3
answers
190
views
Execute script when process reaches 6 hours of lifetime
I wonder if it's possible to execute a perl script when a process with a given PID file reaches a total of 6 hours of lifetime? Can this be done through crontab or similar?
The perl script I want to ...
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:
...
0
votes
1
answer
763
views
redirecting output in crontab
I have a shell script to monitor table stats and java apps. It works fine when I run manually. But if I put it in the crontab it will get stuck if I don't redirect it's output with export display ...
1
vote
1
answer
922
views
Shutting down Linux server on first Wednesday of every month
I have written a crontab entry as:
00 19 1-7 * 3 /sbin/init 0
It should turn my linux server off on the first Wednesday of every month. Unfortunately the server went off on today (Thursday). Can ...
0
votes
1
answer
236
views
Cronjob immediately shuts down mac after boot
I was messing around with cronjob trying to get it to forcibly shut down at a certain time everyday, but now I can't keep my computer on. It boots, loads whatever needs to load on startup, then ...
0
votes
1
answer
94
views
Using undefined time in a crontab job
What happens if you program a crontab job like this:
* * * * * the command
Will it be executed every minute, or what?
0
votes
1
answer
185
views
Getting crontab error on Xubuntu
When running the command crontab -e i get the following error:
no crontab for 'myusername' - using an empty one
888
Can anyone please help?
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) ...
0
votes
1
answer
1k
views
Cron unable to run shell script
I have been trying to get a shell script to run for hours using cron to no avail. I am trying to have the following bash script run every minute
#!/bin/bash
PATH=/usr/local/bin/ices:/usr/local/sbin:/...
0
votes
1
answer
2k
views
Can't get a script to run on startup in Debian 7
I want to get this script to run on startup on my Debian Wheezy server:
/usr/bin/bitcoind
so I go:
$ sudo crontab -e
@reboot /usr/bin/bitcoind 2>&1 >/tmp/bitcoind.out &
Then save and ...
0
votes
1
answer
443
views
scheduling a script that accepts one argument in crontab
i am trying to schedule a shell script that runs for every 10 mins, and the script accepts some argument.. i have done it like this
0,10,20,30,40,50 * * * * sh /home/vpnuser/VPN_BL_GUI/VpnJboss/bin/...
2
votes
2
answers
1k
views
Run Crontab anytime after 4pm
I am trying to run a script through crontab in osx 10.8.5 that will run at 4:30.
30 16 * * 1-5 /Library/Frameworks/Python.framework/Versions/2.7/bin/python /Users/lego90511/PycharmProjects/Stock\ ...
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 ...
1
vote
2
answers
791
views
Automating python script on a mac not running
I have tried to have this question answered twice now(1, 2). While both were informative none of the solutions have worked, and I don't know why. The first solution was to use launchctl the second was ...
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
...
0
votes
1
answer
780
views
Why nothing happens after crontab?
After executing fllowing command cursor skips to new line and nothing happens
user@machine:~$ sudo crontab
Why?
1
vote
3
answers
1k
views
Crontab job doesn't create db backups with `mysqldump` command
When I type in my VPS:
$ mysqldump --opt --user=root --password=myPass dbName>/home/myuser/dbName.sql
it works and makes a backup of my dbName, but if I do it from a crontab job, it creates an ...
0
votes
1
answer
702
views
sending the date in the subject in crontab
In crontab I have the following cronjob working.
0 0 * * * mysqldump -e --user=root --password=MYPASSWORD MYDB | gzip | uuencode db_date +"\%Y-\%m-\%d".gz | mail -s 'date +"\%Y-\%m-\%d"_dump' john@...
1
vote
2
answers
2k
views
Linux - starting a visible terminal on boot
I have a C program I wrote for debian on the raspberry pi that asks the user to enter a number, 1-4 which it then stores in a configuration file. This only happens if the configuration file is missing....
2
votes
2
answers
5k
views
Working with git via crontab
I have the following shell script
#!/bin/bash
REPODIR=$HOME/work/repository/
cd $REPODIR
var=`git fetch --dry-run 2>&1`
echo $var > $HOME/error.txt
I want to run my script every minute, so ...
0
votes
1
answer
2k
views
How can I sync cronjobs from one server to another?
What is the configuration file that defines the cronjobs?
I know you can crontab -e, but it points to a temporary file.
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 ...
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 ...
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:...
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 ...
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> ...
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 * ...
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-...
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 ...
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 ...
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/...
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 *
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 ...