Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Remote call of a shell script using ftp

Posted on 1998-07-06
9
793 Views
Last Modified: 2013-12-26
I'm pretty sure I can do this, but I can't get it to work:
0
Comment
Question by:JetDiesel
9 Comments
 

Author Comment

by:JetDiesel
ID: 1294556
Edited text of question
0
 
LVL 3

Expert Comment

by:dhm
ID: 1294557
The SITE EXEC is not implemented on the HP ftp daemon.  (It's listed in the man page, but the daemon responds to a "SITE HELP" command with the list "UMASK   IDLE    CHMOD   HELP" -- EXEC is missing.)  I tried "SITE EXEC" against several other ftp servers (Solaris-5.5.1, IRIX-6.2, and Linux/RH5.1) and only RedHat recognized "SITE EXEC."  (Even RH didn't work -- probably a configuration issue -- but at least it didn't complain about the command.)

Why not re-write the question as "how can I do X?" instead of "how can I use ftp to run a command?" and maybe somebody will have a simple solution.
0
 
LVL 5

Expert Comment

by:n0thing
ID: 1294558
You can't do that with ftp, site exec is very limited and is mostly available with wu-ftpd deamon. It has been disabled by
default bacause of security problems. I would recommend you
to use remote shell (rsh), telnet ... to do that.

0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 2

Expert Comment

by:blowfish
ID: 1294559
What are you trying to do in your shell script prior to the FTP transfer.  Perhaps there's another way...You say that you are writing a script on a Windows machine to do the file transfer.  Will all of this be running unattended when implemented?
0
 
LVL 1

Accepted Solution

by:
notanexpert earned 300 total points
ID: 1294560
This is a pretty bulky solution .. and requires you to have access to the unix machine (which I assume you have). But theoretically, you could set up a directory on that unix machine that watches for new files. You could upload a textfile as a 'trigger', telling this daemon or whatever to excecute 'blah blah blah'. You could even use the contents of this text file as input to your daemon in case what you actually need to execute changes everytime you log on or whatever.

Now, I've never written a daemon, so I'm not sure how tough that would be. The only other way you co do this is set up a cron job to run every minute or something ... check for the file, and respond with the appropriate action, but that's a pretty messy solution. Basically, this isn't using the FTP protocal or anything to excecute a command, I know, but I think there should be a viable way of setting up some sort of 'trigger' system that would work on the unix end and watch for some particular upload 'key'.
0
 
LVL 1

Expert Comment

by:ksb
ID: 1294561
You can build a named pipe.  Attach the process to get the data to the named pipe and put stuff on the pipe.  Your FTP server might block puts to a pipe, but that could be fixed.

You could even use a portal filesystem .... but that would be using Nukes in a fish tank.

0
 
LVL 8

Expert Comment

by:MaDdUCK
ID: 1294562
No luck yet?
0
 
LVL 1

Expert Comment

by:arbitrary
ID: 1294563
Remote call of a shell script using ftp are just two things completely different embedded into one sentence you might execute shell command using ftp-daemon but that's a hole in the ftp-daemon the FileTransferProtocol is for transfering file
and not subsitue RPC which stands for remote process calls ,
and is being implemented on every POSIX unix system

0
 
LVL 1

Expert Comment

by:arbitrary
ID: 1294564
Remote call of a shell script using ftp are just two things completely different embedded into one sentence you might execute shell command using ftp-daemon but that's a hole in the ftp-daemon the FileTransferProtocol is for transfering file
and not subsitue RPC which stands for remote process calls ,
and is being implemented on every POSIX unix system

0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question