General discussion

Locked

Can ftp execute script on remote server?

By kittielemieux ·
Using ftp to send files to remote server and I would like to execute a shell script on the remote server before ending ftp session. Is that possible? Using macdef init in .netrc file to carry out my ftp session. Tried using the command !script_name but it couldn't find the script and I suspect that it's because of my $PATH - how do I set that? I cd'd to the dir that had the script, and tried !./script_name - still no luck. Thanks, Danielle

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by kittielemieux In reply to Can ftp execute script on ...

Here's my output when trying to execute the script manually:

Remote system type is UNIX.
Using binary mode to transfer files.
ftp> !/var/opt/dci/QA19/interface/ftpout.sh
sh: /var/opt/dci/QA19/interface/ftpout.sh: not found.

The file is there:
QA19:/var/opt/dci/QA19/interface => ll | grep ftpout.sh
-rwxrwxrwx 1 editst ediT 553 Oct 18 12:59 ftpout.sh

Collapse -

by Jaqui In reply to Can ftp execute script on ...

1) did you chmod it to allow for execution?
2) does remote server allow you to run scripts?
3) no, ftp does not normally allow for script running on remote hosts.

Collapse -

by kittielemieux In reply to Can ftp execute script on ...

I figured out my answer, in that I will have my script ftp the files and then use rexec to kick off my script on the remote server. Now my question is related to ftp and rexec sharing the same .netrc entry. Supposedly, rexec doesn't recognize the macdef init entry for the ftp command. But when execute rexec while the macdef entry in the .netrc file, I get a Memory Fault. Anyone have any ideas about that? Thanks!

Back to Linux Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums