Russ has asked for the wisdom of the Perl Monks concerning the following question:

Moved from Categorized Q&A by Q&AEditors
Please do not vote for this node. It will affect the wrong user. Thank You

I have one problem here.I put my cgi file inside server A, and what I want is that when the cgi file is run,it will put the other file(html or wml) in server A,inside another server,let's say(server B).the cgi program is in the server A, and I do not have privilege to modify it ,since I am not system admin.Is there any way I can do it?

FTP between different server.

  • Comment on How to send file between different server?

Replies are listed 'Best First'.
Re: How to send file between different server?
by lhoward (Vicar) on Jul 19, 2000 at 20:56 UTC
    FTP is a great way to do this kind of thing. See the Net::FTP module for more info.
RE: How to send file between different server?
by spectre (Scribe) on Jul 19, 2000 at 21:04 UTC
    I would try a cronjob solution that others would probably not use, there are certainly better ways, but you can look at using scp, something like:
    $file = `ls location/of/file/the/cgi/outputs`; if ($file eq "the expected file location") { `scp $file user@server:location`; }
    If you have your ssh identities set up correctly the above should work if you add it to the crontab, it will check for the existance of the file then put it where you want on the second server, all without modifying the CGI.
    This IS a hack, but it's what I would try first if I didnt have rights to modify the CGI.

    Regards,
    spectre