FTP Quote - will it work?!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting FTP Quote - will it work?!
# 1  
Old 02-21-2011
FTP Quote - will it work?!

Hi,

SCENARIO:
I will be FTP'ing a file to a remote server then running an FTP Script on the destination server remotely. Can I achieve this via FTP and the "quote" command, anyone got experience using this?

FTP Script (untested as I can't FTP the files freely..live environment)
Code:
open Server
user username password
cd destination directory
lcd source directory
put file renamedasthis
quote ksh /thisdirectory/autotrans  /thiscript/ftpthefilesomewhere
close
bye

Whilst I am assuming quote can handle this, is there a better/different way of executing the remote FTP script (easy way)?
# 2  
Old 02-21-2011
Unless the remote FTP server supports a ksh subcommand, the ftp quote subcommand cannot be used for this purpose.

The purpose of the quote subcommand is to bypass the FTP interface of your local host. It is typically used to send commands that the remote FTP server understands, but that the local FTP client does not understand.
# 3  
Old 02-21-2011
thanks,

I think the remote server does support the ksh commands..because i took the command from that server (i just need to execute it remotely).

I just wanted to make sure FTP could execute the script and it wasn't limited to just unix commands (like chmod or user etc)??? (another ftp script in this case).
# 4  
Old 02-21-2011
I think you are mistaken.
The ftp command only responds to ftp commands.

As others advise, the "site" command is for local non-standard commands (see "man ftpd" on the target computer).

What Operating Systems and Shell (with versions) do you have on the source and destination computer?
Do you have administrator access to both computers?

Last edited by methyl; 02-22-2011 at 08:08 AM.. Reason: "Shell" not "Sell"!
# 5  
Old 02-21-2011
Source Server = Solaris 10
Destination Server = Solaris 9

I have root access to both servers.

I will be transferring 1 file from to destination from source, then I need to move that file from the destination to another windows server (FTP already in place for that part, that is why I would like to remotely activate that script)

what do you mean by sell version?
# 6  
Old 02-21-2011
As you are using plain FTP between the servers, I assume that you trust the network to handle unencryted traffic. Could you consider a command to follow the FTP code you have written to put the file to issue a remote shell command to the destination?
Code:
#!/bin/ksh
#
ftp -n <<-EOFTP
open $destination
user bob password
cd $target_dir
put $file $targetfile
quit
EOFTP

rsh $destination "$shell_command with parameters"

You will need to open up the destination to accept the remote shell command, but if that is the way to go, we can talk about that later.

Many here will probably suggest that SFTP is a better method, and with that you would SSH remotely run the command, but I cannot comment on how to set that up.



I hope that this is useful.

Robin,
Liverpool/Blackburn
UK
# 7  
Old 02-21-2011
io'll google rsh tomorrow

SSH is a possibility, how can I achieve it though!?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

PING to AIX works but TELNET FTP SSH doesn't work

root@PRD /> rsh DR KFAFH_DR: protocol failure due to unexpected closure from server end root@PRD /> telnet DR Trying... Connected to DR. Escape character is '^]'. Connection closed. root@PRD /> ftp DR Connected to KFAFH_DR. 421 Service not available, remote server has closed connection... (2 Replies)
Discussion started by: filosophizer
2 Replies

2. Shell Programming and Scripting

FTP xlsx file doesn't work ...contains wierd characters.

Guys, I've a xlsx file containing pivot tables and my job is to FTP it from one Linux terminal to another. I use the script below : ftp -in xxxx > /ftp.log 2>&1 <<EOT user xxx yyyy binary cd <directory> put xxx.xlsx `basename xxx.xlsx` bye EOT After the file is received in the FTP... (2 Replies)
Discussion started by: bhagat.singh-j
2 Replies

3. Shell Programming and Scripting

Replacing all but the first and last double quote in a line with a single quote with awk

From: 1,2,3,4,5,This is a test 6,7,8,9,0,"This, is a test" 1,9,2,8,3,"This is a ""test""" 4,7,3,1,8,"""" To: 1,2,3,4,5,This is a test 6,7,8,9,0,"This; is a test" 1,9,2,8,3,"This is a ''test''" 4,7,3,1,8,"''"Is there an easy syntax I'm overlooking? There will always be an odd number... (5 Replies)
Discussion started by: Michael Stora
5 Replies

4. Shell Programming and Scripting

Replacing Double Quote in Double Quote incsv file

Hi All , We have source data file as csv file and since data could contain commas ,each attribute is quoted into double quotes.However problem is that some of the attributa data also contain double quotes which is converted to double double quote while creating csv file XLs data : ... (2 Replies)
Discussion started by: Shalini Badal
2 Replies

5. Shell Programming and Scripting

replacing a quote in some lines with multiple quote fields

i want to replace mistaken quotes in line starting with tag 300 and relocate the quote in the correct position so the input is 223;25 224;20100428064823;1;0;0;0;0;0;0;0;8;1;3;9697;18744;;;;;;;;;;;; 300;X;Event:... (3 Replies)
Discussion started by: wradwan
3 Replies

6. Shell Programming and Scripting

Regex in grep to match all lines ending with a double quote (") OR a single quote (')

Hi, I've been trying to write a regex to use in egrep (in a shell script) that'll fetch the names of all the files that match a particular pattern. I expect to match the following line in a file: Name = "abc" The regex I'm using to match the same is: egrep -l '(^) *= *" ** *"$' /PATH_TO_SEARCH... (6 Replies)
Discussion started by: NanJ
6 Replies

7. Shell Programming and Scripting

double-quote inside double-quote

hey all, i made a simple .sh like this: echo "<style media="screen" type="text/css">@import url("main.css");</style>" but the output is: <style media=screen type=text/css>@import url(main.css);</style> i want to keep double-quotes, can anyone help me? thanks (3 Replies)
Discussion started by: indraf
3 Replies

8. Shell Programming and Scripting

Capturing Data between first quote and next quote

I have input file like RDBMS FALIURE UTY8703 'USER_WORK.TEST' .HIghest return code '12' I want to parse data which comed between first quote till next quote USER_WORK.TEST can you please suggest how to do that (4 Replies)
Discussion started by: scorp_rahul23
4 Replies

9. UNIX for Dummies Questions & Answers

FTP doesn't work

Hi! I have 2 servers. The firts has vsftpd server with this configuration: # Example config file /etc/vsftpd.conf # # The default compiled in settings are fairly paranoid. This sample file # loosens things up a bit, to make the ftp daemon more usable. # Please see vsftpd.conf.5 for all... (2 Replies)
Discussion started by: Torquemada
2 Replies

10. UNIX for Advanced & Expert Users

FTP Server doesn't work??

I appreciate iif anybody can help me with this issue. I set up a Linux FTP server which is authorized user ID from AD. I do some configuration on vsftpd.conf file but it doesn't work out. I copy these configuration, can you help me to check again as when i connect through browser it always give me... (2 Replies)
Discussion started by: cthinh
2 Replies
Login or Register to Ask a Question