LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 02-14-2008, 01:44 AM   #1
yuiy88
LQ Newbie
 
Registered: Feb 2007
Distribution: Fedora&Debian
Posts: 10

Rep: Reputation: 0
Cron not running sometimes


Hello all,

Can anyone please tell me why does my cron is not working sometimes?

I have checked the cron log but found nothing suspicious...Please help...

Thank you
 
Old 02-14-2008, 01:46 AM   #2
livetoday
Member
 
Registered: Jun 2006
Location: India
Distribution: RHEL,Suse,Fedora
Posts: 106

Rep: Reputation: 15
Provide details !
 
Old 02-14-2008, 01:53 AM   #3
yuiy88
LQ Newbie
 
Registered: Feb 2007
Distribution: Fedora&Debian
Posts: 10

Original Poster
Rep: Reputation: 0
I'm using Fedora Core 4...

Then, I'm running a cron to start my backup postgresql database script. However, it does not start sometimes...

Can please suggest any method to determine the problem?
 
Old 02-14-2008, 02:10 AM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,965
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
Does the script work ALWAYS from the command-prompt? Are
you saving the output from the script anywhere?

Post the script if you're not sure how - I'm sure someone
can aid you in this...

And what does the crontab-entry look like?


Cheers,
Tink
 
Old 02-14-2008, 02:24 AM   #5
yuiy88
LQ Newbie
 
Registered: Feb 2007
Distribution: Fedora&Debian
Posts: 10

Original Poster
Rep: Reputation: 0
Here's my crontab

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
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

I using the crontab above to run the script daily. My script is put in /etc/cron.daily/
 
Old 02-14-2008, 02:29 AM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,965
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
OK - so back to the script :}
 
Old 02-14-2008, 02:37 AM   #7
yuiy88
LQ Newbie
 
Registered: Feb 2007
Distribution: Fedora&Debian
Posts: 10

Original Poster
Rep: Reputation: 0
CLUSTERDB=/usr/bin/clusterdb
VACUUMDB=/usr/bin/vacuumdb
BACKUPSCR=/home/test/complete-backup.sh
OPTIMIZER=/home/test/optimize-backup.sh

nice -n 19 su - postgres -c "/usr/bin/time $CLUSTERDB -a -e"
nice -n 19 su - postgres -c "/usr/bin/time $VACUUMDB -a -e -f -z"
nice -n 19 su - postgres -c "/usr/bin/time $BACKUPSCR"
nice -n 19 /usr/bin/time "$OPTIMIZER"

Here's my script in my cron.daily. The script is working but sometimes the cron does not want to start.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running a cron as root koobi Linux - Newbie 7 06-17-2006 09:38 AM
running apt-get in cron firefly2442 Debian 2 04-29-2004 10:50 PM
Cron job not running? james_cwy Linux - Newbie 6 12-14-2003 08:24 PM
Cron not running Half_Elf Linux - Software 4 01-10-2003 02:38 AM
running X programs with cron NGraphiX Linux - General 5 12-27-2002 01:21 AM


All times are GMT -5. The time now is 08:59 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration