Questions tagged [cron]
cron is a task scheduler based on clock time that runs on Linux-based machines.
912
questions
3
votes
1
answer
2k
views
crontable OR conditions
Crontable parameters seem to function as 'ands' conditions. So the example
0 9-5 * * 1-5
Runs when the conditions are met "minute is zero AND hour is between 9 and 5 AND day is between monday and ...
0
votes
0
answers
167
views
Will my weekly cron job work?
I'm just getting back into bash scripting and I want my cron job to run every 15 minutes between 9.15 and 10 PM. I've checked the script works, but I don't know if it's the right command:
SHELL=/bin/...
18
votes
4
answers
23k
views
ssh Permission denied only in cron job
Having a very strange problem. I've created a small bash script which runs a command on a remote host via ssh (using public key authentication).
When I run this script manually from the command line ...
4
votes
2
answers
3k
views
Auto suspend after X minutes to stop myself procrastinating
Right now, I'm using a line in /etc/crontab to run pm-suspend every 30 minutes, but I would like an application displaying a warning before suspending (for example a countdown in the taskbar). An ...
1
vote
2
answers
3k
views
SShfs and security
I have following questions:
If I mounting sshf mail@host:/home/mail ./foo Is it any way to restrict possibilities of mounting and to not give shell access? All I want is remote, secure storage for ...
8
votes
4
answers
19k
views
how do i run a script 5mn after startup?
I have severals RoR websites running on my webserver and I need to run a ruby script at startup.
So, I puted a bash script in /etc/init.d witch call a ruby process.
Unfortunatly that ruby process ...
3
votes
2
answers
18k
views
crontab - /bin/sh: wget: command not found
I want to set up a crontab on my Macbook Pro running Lion. I run the usual crontab -e and provide a quick job to see if everything is working ok ---
*/10 * * * * wget -O - -q -t 1 http://site.local/...
0
votes
2
answers
2k
views
Windows app to grab webcam snapshots?
I want to periodically capture an image from a webcam attached to a Windows PC, and upload it to a Linux server on the network (preferably FTP, could be SFTP or even Samba).
The images have to be ...
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 ...
4
votes
1
answer
3k
views
Is it possible to add directories under cron.d?
I wanted to partition a single cron file into separate logical units and place them in subdirectories. One folder under cron.d would have all crons associated with say, removing certain types of ...
1
vote
0
answers
574
views
Inconsistencies with SCP for Ubuntu and Windows Server 2003 (using CygWin 1.7.x.x)
Some days ago I was able to scp to the remote server from my windows server 2003 using cygwin to copy the id_rsa, using scp (id_rsa.pub location) [email protected] now it(scp) seems to be not working. ...
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 ...
1
vote
1
answer
1k
views
What might cause cron jobs to occasionally not run or complete?
In my crontab, I have set MAILTO and a bunch of cron jobs (5-10 jobs).
These cron jobs usually run fine and I get emails for them. Most of these jobs consistently run as expected. Emails and ...
15
votes
1
answer
56k
views
Why is my crontab not running
I have this cron
38 * * * * /bin/bash -l -c 'cd /var/rails/site/releases/20120705144335 && script/rails runner -e qa '\''Play.load_lists'\'''
I have this cron under the a different user so ...
2
votes
2
answers
627
views
Cron Job that restarts crashed game
So I'm hosting a game that is very tempermental and can crash a lot on Linux, I made this cronjob to restart the screen and game should it fail:
#!/bin/bash
for t in {1..12} do
if [ -z "$(ps -C ...
2
votes
2
answers
2k
views
crontab -e fails to start
whenever I try to run
crontab -e
I'm getting errors such as:
no crontab for banana - using an empty one
/tmp/crontab.oeFm1e: Invalid argument
Is there any way to edit / install the file?
0
votes
0
answers
38
views
Run checkgmail as a cron job [duplicate]
Possible Duplicate:
How do I make cron run a Java GUI application?
I use checkgmail at work constantly, but this application has a memory leak, and after a week (I never shut down my work machine)...
4
votes
1
answer
2k
views
Schedule bash script for one time use on OSX
I'm trying to do a little script that, as a function, will take a file and date as input and delete that file on the specified date.
So I only need it to schedule to run once, and that's it.
I'm on ...
3
votes
1
answer
15k
views
How to delete directories older than one hour (cron job)
My application creates directories when user performs certain action. These directories are stored on my machine for exactly one hour and than are deleted.
Now I would like to move the 'deleting ...
1
vote
1
answer
188
views
In OS X Lion under zsh, how can I set up a /Users/username/tmp directory which deletes after X days?
I'm new to scripting and regular jobs on OS X, so appreciate the help in advance.
I'm looking to have a tmp directory in my homedir, as in /Users/username/tmp which I can use as my "downloads" ...
6
votes
1
answer
5k
views
Is there a aliases file for sSMTP?
I installed sSMTP for sending emails from command line.
I want to create some alias for cron jobs:
$ sudo vim /etc/aliases
# append this line at the end
myname: root
$ newaliases
newaliases:...
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
...
6
votes
1
answer
39k
views
How to use @reboot for crontab with delay
In crontab, I can use @reboot to run a command after the system reboot. Is there a way to do this with an delay, i.e. run a command after 10 minutes of reboot?
-1
votes
2
answers
922
views
cron uid:gui for every username
So in the nutshell :
There was user John with 502:502.
After i deleted John and recreated him, his UID:GID changed to 504:504.
Cronjobs are still running under the John's crontab, but when the ...
1
vote
2
answers
2k
views
How can I perform a cron job every minute?
Are the following cron configurations identical?
* * * * *
0 * * * *
1 * * * *
I'm looking for a configuration that will run the job every minute.
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 ...
0
votes
1
answer
931
views
"Permission denied" when trying to use RVM with Cron
I am trying to employ the method descibed here.
My crontab:
# m h dom mon dow command
@reboot /home/qe2user/.rvm/environments/ruby-1.9.3-p125 /home/qe2user/Ruby/test/prog.rb > /home/qe2user/...
0
votes
1
answer
509
views
Running cronjob on specfic hours
How do i setup a cronjob to run every hour except from 11pm until 1am ?
Because during that time, the system is doing maintenance.
Cheers
0
votes
1
answer
330
views
Cron view on VPS
How can I view all cron jobs scheduled on my Linux Ubuntu VPS? When I use crontab -l I do get a list of cronjobs but I cannot see the ones that are scheduled by WordPress, how can I also see the ones ...
2
votes
1
answer
637
views
How to set-up date for cron weekly backup?
I'm writing a command for cron to do automatic backups for my flashdrive.
I use tar ... -N <some date> to make the backup.
The issue is how to write the command which gives me the right date.
...
72
votes
2
answers
124k
views
Set a cron every certain hours between certain hours
How can I set a cron to run every 2 hours between 8 am and 5 pm for example? Is this possible?
0
votes
1
answer
873
views
Convert cronjob to launchctl plist
I should convert this cronjob to a launchctl plist.
Is this possible?
0 8-18 * * 1-5 /usr/bin/curl -s --data "par1=a&par2=b&press=OK" http://mydomain.com/file.php /dev/null
3
votes
2
answers
582
views
Cron job once a minute for one hour a day
Is there a way to run a cron job once a minute for an hour every day?
I know I can probably make 60 cron jobs to do this but that would make it difficult if I ever needed to edit the job.
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
...
1
vote
0
answers
1k
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 osp-...
3
votes
3
answers
7k
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
http://www.thegeekstuff.com/2009/06/15-...
51
votes
1
answer
94k
views
what is run-parts in /etc/crontab, and how do I use it
I have been digging through my Linux system. To try and understand how it all works
In the /etc/crontab file. I see the following
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * ...
1
vote
1
answer
561
views
How is crond daemon started without an init.d/chkconfig entry?
I'm running a sandbox server with Fedora 15. I've gathered that since my crontab file has no entries (ie. ***** run-parts /dir/) for scheduled run-parts, it is not currently configured. The ps command ...
21
votes
4
answers
14k
views
How did I wipe out all my cron jobs?
I have accidentally wiped out all my cron jobs. I'm not sure what I have done. I don't remember deleting entries from it by issuing crontab -e. What are the possible ways that the cron jobs can be ...
0
votes
3
answers
2k
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
[email protected]
* * * * * (echo '...
1
vote
2
answers
676
views
Debian Linux cron stubbornly refuses to run at right time
I have a Debian Linux server, recent install. It has this cron job:
7 1 * * * /do/something/important.sh
As I read that, it should run at 1:07am. Instead, it runs at 5:07pm.
So, wrong ...
1
vote
1
answer
1k
views
Need to set cron for random intervals with iMacros
I am trying to learn about cron for iMacros but I don't know where to look. Google was no help.
Basically I have script I wrote, a series of commands, like this:
Line 1
Line 2
Line 3
etc.
What I ...
5
votes
2
answers
3k
views
Shell script of mysqldump works fine when run manually, but does not run in the cron job?
I have a shell script to get a MySQL database dump. This script works fine when run manually
#!/bin/sh
fqn=/home/Mysqluser/daily_dumps/bookstore_`date +%Y%m%d_%H%M%S`.sql.gz
mysqldump -u root -h ...
1
vote
0
answers
55
views
query a URL every H hours for changes in the results?
How can I query a specific URL (mostly html and js) every H hours for changes in html content, which is mostly an html table with some header, and have the results fed to an RSS? This URL in question ...
1
vote
2
answers
2k
views
Writing a cron job to email myself
How would i write a simple cron job to email myself a message at a certain time? Also is it possible to create a cron job without root access. I'm trying to use my school's server?
0
votes
2
answers
3k
views
What is the difference between "periodic" and "cron" on OS X?
I bought a book on OS X and it says that launchd now control the scheduling of cron tasks, it this true?
Also it says that if I place commands in /etc/daily.local that they will execute after the ...
16
votes
2
answers
15k
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...
2
votes
5
answers
1k
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 ...
2
votes
1
answer
6k
views
How can I write a cron job to archive my log files every night?
I assume this is relatively easy but my shell scripting isn't that great so I'm hoping to get some help.
I have a task which runs every hour and appends its output to a log file. I'd like to move ...
1
vote
1
answer
4k
views
why does my python cron job time out?
I have a long cron job running a python script in CENTOS, but for some reason it seems to timeout or otherwise end without completion.
the job runs fine when executed straight from bash, but seems to ...