BSD Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
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:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #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


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway