Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: triggering a program in web server

by arthas (Hermit)
on Aug 18, 2003 at 10:34 UTC ( #284531=note: print w/replies, xml ) Need Help??


in reply to triggering a program in web server

Hi!

You can launch the upload-to-B program directly from the script which, on A, receives the file uploaded via web. This might however slow the response to the user down, depending on how fast is the connection between A and B.

Another option is to have upload-to-B program run as a daemon, which every now and then (how much often you wish) checks for new uploaded files and sends them to B.

Hope this helps!

Michele.

Replies are listed 'Best First'.
Re: Re: triggering a program in web server
by tja_ariani (Acolyte) on Aug 18, 2003 at 10:41 UTC
    Hi,

    you're rite, I was thinkin to have the program run as a daemon, but I do not know how to do the scheduling part.
    Is there any simple program or piece of code as an example to show how to do this ?

    I was thinkin using infinite loop in the program to check, but will it slow down the server ?
    Or is there any command to 'sleep' the program periodically ?

    Thanks

      A possible approach is: every time a file is uploaded you put a link to that file in a special directory; then every n seconds (via cron or using sleep) you check the directory, move new files and delete links.

      HTH, Valerio

      I was thinkin to have the program run as a daemon, but I do not know how to do the scheduling part.

      Take a look at Net::Daemon . But I can't see the advantage of running this as a daemon is (the small performance gain of not loading Perl?).
      --
      bm

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://284531]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2019-05-26 06:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (153 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!