.netrc does not execute mput command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting .netrc does not execute mput command
# 1  
Old 09-30-2011
.netrc does not execute mput command

Hi all Smilie

i' ve a script running on freebsd system:

Code:
echo "Start FTP Transfer"

cd /tmp/elaboralog

ftp -i 192.168.27.147 2100 > /tmp/elaboralog/ftp_log_phase2

That call .netrc

Code:
machine 192.168.27.147
login user
password 12345
macdef backup
binary
cd tmp/elaboralog
mput *-file.txt
quit

I can see the host authenticating successfully on the server ftp but hanging for ftp commands.Smilie

It seems that the .netrc stops at 'cd' command. Smilie
# 2  
Old 09-30-2011
Maybe the slash missing in front of tmp?
# 3  
Old 09-30-2011
TnkX for answer. Smilie
But.. no i've tryied in both ways...Smilie
# 4  
Old 09-30-2011
Perhaps try putting prompt on the line before the mput?

(and you really should have the / before tmp.
# 5  
Old 09-30-2011
Sorry
i've also tryed with "prompt" and "prompt off" ... no way Smilie
# 6  
Old 09-30-2011
I know the behaviour can vary between client implementations of ftp... (and so in what you should have in .netrc ...) look at the man pages of your release (netrc (4)) to see if we missed something
# 7  
Old 09-30-2011
Also, you've defined the macro "backup". Where did you ever call it?

Code:
Connected to myserver1
220 myserver1 FTP server (Version 4.2 Fri May 2 12:48:10 CDT 2008) ready.
331 Password required for root.
230-Last unsuccessful login: Thu Dec 09 21:16:11 NFT 2010 on ftp from myserver2
230-Last login: Fri Sep 30 12:53:58 DFT 2011 on ftp from myserver2
230 User root logged in.
ftp> $ backup
cd /tmp
250 CWD command successful.
pwd
257 "/tmp" is current directory.
prompt
Interactive mode off.
mput *-file.txt
200 PORT command successful.
150 Opening data connection for 1-file.txt.
226 Transfer complete.
28960 bytes sent in 0.001277 seconds (2.215e+04 Kbytes/s)
local: 1-file.txt remote: 1-file.txt
quit
221 Goodbye.

Just curious, but is there any compelling reason not to use scp for this?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Execute ssh command with additional terminal command to any remote user not working script

Hello i am having an issue with bash script and this is the code now=$(cat hosts1.txt | awk '{print $2;}') while read n ;do ssh root@$now 'useradd test1; echo -e "test1\ntest1" | passwd test1 && echo "test1 ALL=(ALL:ALL) ALL" >> /etc/sudoers' When i execute only part with cat, it... (8 Replies)
Discussion started by: tomislav91
8 Replies

2. Shell Programming and Scripting

Second try mput failed

I'm having few doubts with below questions not able figure out the reason: mput operation used via shell script failed with 550 code return from FTP - "Overwrite cannot be done". ( Having all permissions to this directory ) but why got failed. When trying to run the script again but now it... (3 Replies)
Discussion started by: Gautham
3 Replies

3. Shell Programming and Scripting

When i am trying to execute export command within a shell script it is saying command not found.

I am running the export command within a view to use that value inside my build script. But while executing it it is saying "export command not found" My code is as follows: -------------------------- #!/bin/sh user="test" DIR="/bldtmp/"$user VIEW="test.view1" echo "TMPDIR before export... (4 Replies)
Discussion started by: dchoudhury
4 Replies

4. Shell Programming and Scripting

mput question

I want to mput a file without extension, and while doing the mput i want to include the .txt as an extension to the file name. How can i do that? (2 Replies)
Discussion started by: wizardofoz
2 Replies

5. UNIX Desktop Questions & Answers

How to grep and pipe to mput ftp

I am ptting the following into an FTOP script. date=`TZ="aaa24" date +'%Y%m%d'` # this gets Yesterday date . . . . mput < 'l | grep $Vdate' # the idea to grep a listing from a directory that has yesterday date in its file name then put it in the remote FTP server. How can I get it... (4 Replies)
Discussion started by: raouf@comcast.n
4 Replies

6. Shell Programming and Scripting

SFTP - 'put' doing an 'mput'

Hi guys, I'm having a problem with F-Secure Unix. When I try a simple command; sftp> put local.test remote.test I expect that the local file local.test would be copied to the remote file remote.test However sftp is attempting to copy local.test & remote.test from the local machine, as if... (2 Replies)
Discussion started by: b0bbins
2 Replies

7. Shell Programming and Scripting

mput is not working in ftp script

1)In this script mput command is not working( not transfering multiple files, it is able to send single file) 2)here is the script to automate the ftp process . 3)for transfering files from one machine to other machine using ftp can anyone can give me the solution in this issue Script is... (6 Replies)
Discussion started by: gsri
6 Replies

8. Solaris

FTP limits - mput *

I am trying to upload via FTP 11,000 files in a Solaris 8 system. I am using Windows 2000 and its FTP client to upload the files. The command used is mput *.jpg.When the quantity of files reaches 10,000 the upload aborts. Is this problem related with the FTP client ? If yes, another FTP client... (2 Replies)
Discussion started by: waldecy
2 Replies

9. UNIX for Dummies Questions & Answers

Plz Help : How to use write command to execute command on some other terminal

Hi Group , I m trying to execute commands on some other system using write command but inspite of executing the commands they r passed as simple messages. - i m writing >write user-id ! ls o ctrl-d inspite of executing the command ls,other terminal shows ! ls. Thnx in advance. (2 Replies)
Discussion started by: Aashish
2 Replies

10. UNIX for Dummies Questions & Answers

mget and mput...

hello, i was interested in knowing if you can mget or mput a sequence of files: example- say i have a dir with 1000 files with the same extension e.g. *.sgi, is there a way to mget only the last 200 files? i would assume that there is a flag i would use, or something like: mget... (14 Replies)
Discussion started by: yoyomamma
14 Replies
Login or Register to Ask a Question