General discussion

  • Creator
    Topic
  • #2188964

    Can ftp execute script on remote server?

    Locked

    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

All Comments

  • Author
    Replies
    • #3070857

      Reply To: Can ftp execute script on remote server?

      by kittielemieux ·

      In reply to Can ftp execute script on remote server?

      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

    • #3046055

      Reply To: Can ftp execute script on remote server?

      by jaqui ·

      In reply to Can ftp execute script on remote server?

      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.

    • #3045782

      Reply To: Can ftp execute script on remote server?

      by kittielemieux ·

      In reply to Can ftp execute script on remote server?

      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!

Viewing 2 reply threads