Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

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 March 10th, 2001, 04:13 PM
dave_0 dave_0 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 5 dave_0 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i wrote a perl script to copy the iplog and message logs to anoter dir to reduce some of the massive log files we get. It works fine when i run it as root, but when i put it in the cron, thats another story. It copies everything fine, and restarts syslogd, but it won't restart iplog. I'm fairly new to perl, and this may be the worst script ever. Any input is welcome.
-Dave

---clipped $date variable---
system("iplog --kill");
system("mv /var/log/messages /root/logs/messages-$date");
system("touch /var/log/messages");
system("mv /var/log/iplog /root/logs/iplog-$date");
system("killall -HUP syslogd");
system("iplog");
};

Reply With Quote
  #2  
Old March 11th, 2001, 12:37 AM
dwarf dwarf is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 300 dwarf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Try adding this to the last system() call:
Code:
system("iplog") && die($!);


and then run the script and see what errors come up. If any come up. Other than that, the only thing that comes to mind is that maybe you are didn't set up crontab right. Try setting up the script to run as root under crontab as well (if you didn't already)...

Reply With Quote
  #3  
Old March 11th, 2001, 12:48 AM
dave_0 dave_0 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 5 dave_0 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Wink

alright thanks for that, when i ran it as root, it worked. Will have to wait and see if it works in the cron. yes, it is running in the roots cron =)

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > perl script + crontab = problem


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 | 
  
 





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