BSD Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsOperating SystemsBSD Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 19th, 2001, 07:59 PM
adamst68 adamst68 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 11 adamst68 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cron ??? How to make sure it's working

hello there,

I have a script that needs to be run each day called whatever.sh

How do I -

1) see if it is already running
2) If it ain't running, how do I start it ?

any help will be greatly appreciated,

cheers,

Adam

Reply With Quote
  #2  
Old December 19th, 2001, 11:57 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
1) Check the process (ps aux).
Check your /var/cron/log file.

2) It's started automatically on boot by default.

/etc/defaults/rc.conf:

cron_enable="YES"

If you put cron_enable="NO" to /etc/rc.conf, then of course, /etc/rc.conf overrides /etc/defaults/rc.conf, then NO.
If you don't pipe the output to /dev/null, cron by default will send the output to your root email account, if it's a root crontab.

Reply With Quote
  #3  
Old December 20th, 2001, 12:18 AM
adamst68 adamst68 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 11 adamst68 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks a lot for that - cron seems to be running OK,

one question though, I have found some files in the /var/log directory but am unsure if they're the one's I need
/var/log/cron
/var/log/cron.0.gz
/var/log/cron.1.gz
/var/log/cron.2.gz
/var/log/cron.3.gz

I tried to open these files with no luck. Am I doing it right and looking in the right place.

cheers,

Adam

Reply With Quote
  #4  
Old December 20th, 2001, 12:50 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
First off, sorry for the incorrect info I provided previously. Cron's log should be /var/log/cron instead of /var/cron/log. I got mixed up with NetBSD and OpenBSD because /var/cron/log is the location for them.

>> I tried to open these files with no luck

/var/log/cron is the current one. The ones with *gz extension are rotated by newsyslog (/etc/newsyslog.conf). That said, they are old cron logs. You can view them by zcat, not cat.

Reply With Quote
  #5  
Old December 20th, 2001, 12:59 AM
adamst68 adamst68 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 11 adamst68 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks very much for that, much appreciated.

Is it possible to search those logs to see if and when the script sophos.sh was run ?

cheers,

Adam

Reply With Quote
  #6  
Old December 20th, 2001, 01:09 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
To search? You should just check your current one /var/log/cron. Just tail it if you don't like cat.

>> when the script sophos.sh was run ?

You mean for the old logs? Then just run: zcat cron*gz | grep "sophos.sh" | awk '{print $1,$2,$3}' >> /root/sophos_log and view your sophos_log any way you want.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsBSD Help > Cron ??? How to make sure it's working

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap