Solved

Remote call of a shell script using ftp

Posted on 1998-07-06
9
783 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

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. …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

777 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