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:
  #1  
Old October 26th, 2000, 05:34 AM
dirk dirk is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 1999
Location: Haarlem, The Netherlands
Posts: 47 dirk User rank is Sergeant (500 - 2000 Reputation Level)dirk User rank is Sergeant (500 - 2000 Reputation Level)dirk User rank is Sergeant (500 - 2000 Reputation Level)dirk User rank is Sergeant (500 - 2000 Reputation Level)dirk User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 h 34 m 41 sec
Reputation Power: 21
Hi All,

I'd like to know how to send an external process to the background, so that I can run multiple instances of the same process at one time. Any tips, links.. etc??

TIA,

Dirk

Reply With Quote
  #2  
Old October 26th, 2000, 02:36 PM
JonLed JonLed is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2000
Location: Indiana
Posts: 614 JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 h 49 m 49 sec
Reputation Power: 10
Well if you're running it from the command prompt you can do it like this:
perl /path/to/file.pl &

the '&' will run it as a background process.

To make the script figure out stuff and run the background take more work.

Reply With Quote
  #3  
Old October 27th, 2000, 08:30 PM
Helicon Helicon is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 15 Helicon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You may need to check time of day within your code.

#!/usr/bin/perl

while (1)
{
($second,$minute,$hour,$day,$month,$year,$week,$isdst) = localtime(time);

if ($hour eq 9)
{
do something ...
}

sleep(3600);
}

exit(0);

Then of course, run your program like the following:
perl youfile.pl &



[This message has been edited by Helicon (edited October 27, 2000).]

Reply With Quote
  #4  
Old November 12th, 2000, 09:21 AM
TrevH TrevH is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 0 TrevH User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Can I just clarify, does background processing mean I could set a script off via Telnet using the above method and log out with the script continuing to run 24/7?

Also, what does "sleep(3600);" mean?

Sorry for the intrusion into the thread, but I think you just solved a few major headaches for me!

Cheers
Trev

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Backgrounding processes


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 2 hosted by Hostway
Stay green...Green IT