Server :: Cron Not Running
Jun 15, 2011Cron on one of my boxes isn't running and I failed to determine why.
Here are what I have found so far:
Password:
Cron on one of my boxes isn't running and I failed to determine why.
Here are what I have found so far:
Password:
I want to make a cron job for my webserver, only it seems not to work...
I have now the followig to test (every 16th minute of the hour, write test to a file), but it doesn't show up. When I write out the cron, it is done to the file: /tmp/crontab.QXsBIO/crontab . How to make cron work? It must be very easy, but I have real troubles getting it fired up.
My Linux version is debian lenny and the cron file looks like (crontab -e):
(with trailing empty line at the end)
I want to create 2 cron jobs daily
1st cron: Every day by 13(1pm) I want to stop the httpd service
2nd cron: Every day by 13:30(1.30pm) I want to start the httpd service
I tried but only 1 cron job can able to run at a time.
I've run into a strange problem on one of the servers I maintain. It's running CentOS 5, fully up to date. The server has Monit installed via RPMforge, and runs Postfix as its MTA. Every day at about 4:20am, when cron is running, Monit loses its connection to Postfix. As far as I can tell, nothing is actually going wrong with Postfix and it's always restarted just fine. I run a couple of Debian servers with very similar setups, and the problem does not occur on them.
Perhaps related, other daemons on the CentOS box often lose their pid files at the time when cron runs, which results in Monit thinking they're not running. One service in particular (zarafa-dagent) is so bad for this that I've had to completely disable monitoring of it in Monit. Again, this problem doesn't occur on the Debian boxes I maintain.The problem isn't hugely urgent as everything still runs fine, but it does mean that pretty much every day I get false positive mail alerts from Monit, which is (a) annoying and (b) makes me more likely to miss a real alert.
Previously I had posted a question on how to make it run every 7 minutes between 7 and and 11pm.However now I found out what I really need is every 7 minuted between 7:30 and 11pm BUT it has to be every 7 minutes, it cannot reset itself on the top of every hour, so the */7 wont work.How can it that it will be every 7 minutes, so it will go at 7:30, 37,44,51, 58, 8:05, etc..
View 4 Replies View RelatedIs my vixie-cron broken? i have "0-59 * * * * root /usr/sbin/logrotate /etc/logrotate.conf" but it is not running in /etc/cron.d.
Code:
My root Vixie cron crontab is set to perform a system snapshot via fsarchiver: 0 0 * * * fsarchiver savefs -o -A /backups/p30_root.fsa /dev/sda2 /dev/sda3 The command itself works fine, generating about a 7G snapshot of my Suse server. I then wish to rsync this to a NAS I have located in another building: 0 3 * * * rsync -av -e ssh --delete /backups/ root{at address}:/DataVolume/os_backups/
(yes, I'm rsyncing as root. I absolutely loathe it, but I got thrown into an quasi-SA position with a ridiculous to-do list and no time to do it. I'm having to make things just work and then go back and try to improve them/learn how. I couldn't make it work in a non-root way quick enough, so for now I'm having to cron rsync jobs as root because of all the differing file permissions on this samba/MySql server. I set the NAS to only accepts ssh from the server IP, and we're behind a campus firewall... It's serious trial by fire.) The crontab also has rsync commands for the samba areas, our specialized chemistry software and affiliated MySQL databases............
I am still an openSUSE noob and have been struggeling to get cron jobs running for the past couple of hours...without having success Hopefully a more experienced user can give me a hand As root I used crontab to setup some cron jobs:
Code:
crontab -u api-cebian -e
The resulting cronjob looks like this:
[code]....
why my second cron job isn't running? The first one runs fine but the second one does not run at all. If I manually run the script using ./check.sh then it does what it is supposed to but will not run from cron. It should run every weekday at 9:45am, it looks good to me but clearly I am doing something wrong.
Code:
# m h dom mon dow command
#This will backup my hosted websites.
0 2 * * * /home/bob/scripts/websitebakscript.sh
#This will run check and upload it's contents to the net.
45 9 * * 1,2,3,4,5 /home/bob/scripts/check.sh
Cron refuses to work for a newbie.I am trying to setup a cron job to backup a folder in my home directory ('/home/scratch') to a folder ('home/internet_backup') that is mounted (using nfs) to a network folder.the folder ('home/internet_backup') is mounted correctly to the network folder upon system startup, so this part works.
View 4 Replies View RelatedI am making a webpage which is to be automatically generated every minute. I've created a cron job in crontab like this:
Code:
0-59 * * * * /usr/bin/php /var/www/site/updatestatistics.php > /dev/null
When I refresh the page 'updatestatistics.php' in my webbrowser it does generate a new page ('statistics.html', which is included in 'statistics.php'). But when I let this cron job do the job, nothing happens. I looked into the log file, it shows this:
Code:
(root) CMD (/usr/bin/php /var/www/site/updatestatistics.php > /dev/null)
After saving a few sample scripts in crontab, I discovered that cron is not running properly on my Ubuntu 9.10 (32 bit), after a recent reinstallation. Please note that the files "/var/log/cron" and "/etc/defaults/rc.conf" are empty in my system.
View 4 Replies View RelatedI have created a conjob via ssh by going to crontab -e and adding my scripts like 05 10 * * * /scripts/old-files-delete.sh.The file has 755 permissions and if I run the script manualy it works fine. I have checked the cron log and it does not show up as running at all.
View 5 Replies View RelatedIs there a way for me to tell cron to run an app BUT not run it if a process exist already?
View 5 Replies View RelatedI have a cron job set up to backup my ~/ directory everyday at 10:00. But the cron job is not running. here is my confile that I loaded into crontab...
Code:
#backup everyday @ 10:00 AM and 10:30 AM
00 10 * * * /home/dave/bin/backup.sh
30 10 * * * /home/dave/bin/music_backup.sh
[code]....
the *.sh are executable. I logged out and logged back in since I put the cronfile in crontab. The commands that I use in the *.sh files work fine when I run them manually.
I seem to be having a problem with cron. I have a python program that checks a specific directory for pending email scripts written in python.
Code:
#!/usr/bin/python
import os
emaildir = os.environ['HOME']+"/email/"
filelist = os.listdir(emaildir)
for pyfile in filelist:
if pyfile.find(".py") > -1:
execfile(emaildir+pyfile)
This code has been tested and works fine. The problem is that I need cron to run this code every 5 minutes but i can't tell if it is running: Here is my cron code:
5 * * * * /home/username/custom/CheckEmail.py >>/home/username/custom/email.log 2>&1
I activated the log (I think) but all i get is /var/log/cron.log and that only logs when I activate/deactivate or edit the cron file. is there anything else i need to set for this to work? I am running Ubuntu 9.10.
I still can't figure out why my cron job isn't working. I'm sure I'm missing something obvious, but it's got me beat
I know cron is executing my script (I had it echo some lines to a file at points within the script, and that text showed up, but none of the files/folders are being copied or removed)
crontab looks like this:
Code:
PATH=/usr/sbin:/usr/bin:/sbin/bin
#m h dom mon dow command
*/20 * * * * /scripts/scriptname
[Code].....
I have a cron job that executes fine in opensuse 11.4. It is located in
/etc/cron.d/publish.cron:
jpablo /srv/django-apps/smcommand/scripts/publish.sh
It is correct, I want it to execute every minute. Now, I copied the same script to ubuntu maverick, and it doesn't run. Perhaps there's some ubuntu peculiarity that I'm not aware of?
I have an external usb hard drive that spins down every 10 min. The commands in 'hdparm' do nothing to override the internal settings. So, I wrote a script to touch a file every 5 minutes, and it will run as root because of the mount command, and I want it to run for every user. The script is executable, owned by root, and root is the group, with 755 permissions.
no_sleep.sh in /usr/sbin:
Code:
#!/bin/bash
# Script to keep external drive from spinning down
diskmounted=$(mount | grep Backup | wc -c)
[Code]....
I have 3 cronjobs set up on my Unix server . Out of which 2 cron jobs run the same script but at different times and the other one runs another script.
So in the 2 jobs which are set to run PMDaily.sh for eg , One runs on Sunday at 8AM and the other runs monday to friday at 6 AM . How ever the Sunday cronjob works (runs through the crontab) but the Cron job set for Monday to Friday is not working. However manually if i run this script it workd perfectly.
Please let me know what could be the possible reasons for this?
I have a script in /root/new.sh .how can i run this script with cron? "how to give path to script?"
View 2 Replies View RelatedI am executing the script.
with help of cron job but it is not executing in cron job.
i check owner and chmod and create the file and execute manually it is working fine but in cron job i set below
Crontab -e
8 14 * * * /home/tplinux/webapp/tpadminhost/collect_ejxml/ejrename.sh
wq!
after that wait till that time but script is giving message no such file in directory but same thing is excute manually it is running fine and found the files.
Below is my script details
file name ejrename.sh. code...
I've setup a git-svn repo with cron to fetch from the svn repo daily. I have a script to do the fetching, and this is what is invoked by cron. Everything is fine with the repo, and the script works fine when executed manually. However, when it runs under cron, empty files get dropped into the .git directory. The files have names that look like they are some base64 output, e.g. juTrvjP6m8 and kcKf3hu3b4. Two of these files show up for every cron run. I thought these might be commit hashes, but they're not, git-show says it's an unknown revision. I set-up the repo as follows:
[code]...
The last line pushes the repo to a separate (bare) public repo from which others can clone. I'm piping the output from the cron job to a file, which looks like this:
[code]...
The line "fatal: unable to run 'git-svn'" is alarming, but the fetch seems to go ahead anyway. Where are these empty garbage files coming from, and how to stop them? Am I in for bigger problems in the future?
For some reason my cron jobs are not running and I can't seem to figure out why.
Here is crontab -l
Code:
SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
[code]...
I use crontab for a daily alarm clock, which stopped working after I moved to Lucid.
Code:
$ crontab -l
# m h dom mon dow command
[code]...
I am running Ubuntu 10.10 on a new Dell PowerEdge.
I built the system ~2 months ago and have successfully been running a list of cronjobs.
The jobs last ran on 5/31/11 at 7:35am. Since then none of the jobs have run.
I see "cron" in the process list when I run ps.
I've been having a bit of trouble running a shell script with cron. A friend of mine does a community radio show and the station has a live stream but no podcasts, so I've set up a script to record the stream and encode it as an mp3 while I'm away using mplayer and lame -that's what I'm trying to do anyway.
Here's the script, but it doesn't seem to run- at least, I don't see any of the files it should be outputing, would they be in the cron.weekly directory (where I have the script) or in my home directory?
#This is a script to record 'The Unnamed Show'
#it will record the show from the live stream, then convert the output #to an MP3
#Finally, it will delete any files no longer required HOME=/home/byron/
Im having some difficulties with running a shell script from cron which I am unable to resolve for almost 2 days now.
For testing purposes, im trying this with simple shell script test.sh with chmod 777
This script is located at /var
When I type /var/test.sh it runs perfectly and prints asdasdasd
When I type /var/test.sh > /home/log it writes asdasdasd to /home/log - works
The problem occurs whenever I add it as a cron job to var/spool/cron/crontab/root
There is: 11 10 * * * /var/test.sh > /home/log - however, at 10:11 there is no file at /home/log
Cron as a service works, forexample, every day at 4 am it makes this backup sshpass -p xxxx rsync -avz -e ssh root@x.x.10.7:/data/backup/ /home/backups/isp_admin
However,
doesnt makes the folder
Where is the catch?
I am using Shell Script to run my Java program. I have written a Cron job to invoke Shell Script every day at 7pm. Cron job is running every day at 7pm ,but it is not invoking my shellscript and also I am not getting any error message. I am able to run same shell script from cmd propmt using bash, and also I am able to invoke the same script from mainframes Universal command job. Same ShellScript and Same cronjob is working fine in my Dev server. But in my QA server it is not working.
View 7 Replies View RelatedI have the following cron configuration in the 'crontab' file:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=<--- REMOVED -->
HOME=/
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
20 16 * * 1-5 root wget [URL]
07 30 * * 1-5 root wget [URL]
11 30 * * 1-5 root wget [URL]
My focus is on the three WGET commands. The problem is the first one works fine, runs at 4:20 p.m., but the other two never run! If I visit [URL] it works fine but cron never runs it.