.netrc does not execute mput command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting .netrc does not execute mput command
# 8  
Old 09-30-2011
Hi i've removed the macro and now this is the new output:
Code:
Connected to 192.168.27.147 (192.168.27.147).
220 TYPSoft FTP Server 1.11 ready...
Unknown .netrc keyword put
Unknown .netrc keyword /tmp/elaboralog/20110928-totale.txt
Unknown .netrc keyword quit
331 Password required for nsm_ftp.
230 User nsm_ftp logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>


Last edited by Scott; 09-30-2011 at 09:17 AM.. Reason: Please use code tags
# 9  
Old 09-30-2011
You can keep the macro. You just need to call it.

Code:
ftp -i 192.168.27.147 2100 << ! > /tmp/elaboralog/ftp_log_phase2
$ backup
!

And the compelling reasons for not using scp? Smilie
# 10  
Old 09-30-2011
Because of the customer is 'compelling' what i have to do SmilieSmilieSmilie
# 11  
Old 09-30-2011
And the customer, as we know, is always right Smilie

I was asking only as it's so long since I touched a .netrc file, I've forgotten most everything about it and FTP!
# 12  
Old 09-30-2011
We seem to have a fundamental problem here.
The error messages are "Unknown .netrc keyword".

The sole and only purpose of a the file called ".netrc" is to hold the username and password to access a remote ftp server. One line per server:
e.g.
machine myservername login myaccount password mypassword

The commands to ftp should not be in the ".netrc" file.

In essence the answer is:
Code:
ftp -i myservername < myfilecontainingcommands > myoutputfile

The "ftp" will read a correctly formatted ".netrc" file to find out the password (providing that the .netrc file is in the right place and has the right permissions).

If this doesn't crack it, please mention what Operating System (and version) and what Shell you are using.
# 13  
Old 09-30-2011
Quote:
Originally Posted by methyl
The sole and only purpose of a the file called ".netrc" is to hold the username and password to access a remote ftp server.
That is not an accurate statement.

It is possible to define macros in the .netrc file, that do contain FTP commands.

The errors the user shows are because the macdef command was removed (but the FTP commands for it were not).

The second code segment in post #1 shows a perfectly valid .netrc file.
# 14  
Old 09-30-2011
@scottn
I see what you mean but the ".netrc" quoted is not valid on normal "ftp" because the "machine" line is split into multiple lines. I didn't notice the "macdef" line ... but I now believe it to be surplus.
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