.netrc and ftp issue

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers .netrc and ftp issue
# 1  
Old 04-09-2005
.netrc and ftp issue

Ok guys (gals?) Im new here as a member, but have come here many times to find answers to questions.
Have played with Unix (ATT Sys 5) and now Linux (RH)...

I told myself I wanst going to ask for help on the current project..but.. I am down to what I think is the last issue:

(and I KNOW the answer has got to be sooo simple yet it is slipping by me)

Using .netrc to ftp to a windows based desktop pc (win 2000 or Xp) and looking for and retreiving a .TXT file once every 30 seconds and then WANTING to DELETE the file (s) on the remote machine after getting them.

All works fine EXCEPT the deletion part.

My .netrc looked like this:

macdef getfile
lcd wxmsg
cd wx
mget *.TXT
delete *.TXT (which of course didnt work)
lcd /usr/weather

I FOUND on here in the FAQ's this script:


Posts: n/a
Here's a sample $HOME/.netrc file:

machine other_host
login user123
password password123
macdef init
mget /users/shaik/*.c
mdel /users/shaik/*.c

So I made mine look like that and it still does everything BUT delete the file on the remote machine - and with no apparent errors!

It appears that the 'BYE" is executed while the "MDEL" is waiting for a "Y" answer to 'do you want to delete this?'

Any help? My head hurts

# 2  
Old 04-09-2005
What you're doing looks like it should work. And it does with the HP-UX ftp client. It could be a client issue. This page mentions:
WARNING: Many ftp clients have a safeguard built-in to the MDEL command, requiring confirmation for each dataset before deleting it. However, the VM/CMS ftp client does NOT request that you confirm each file before deleting: the CMS ftp client just goes ahead and deletes all files that match. So if you are using the VM/CMS ftp client to access MVS, beware!
# 3  
Old 04-09-2005
Humm... Thanks for that tip...

I did not even consider that (was blaming myself)...

Guess I could try to echo a "y" <cr> in the script, dont know if that would play or not..well off tho the other machine

THANKS for the reply!!!
# 4  
Old 04-13-2005
Update on this issue:

The "delete" command in .netrc still dosent work.

However, after looking back over the entire scriptI saw what I thought might be the cure...
I was (am) using autoftp with .netrc ... I realized I had the '-i' option in the auotftp AND the 'prompt' in the modified .netrc which was effectivley canceling each other out..I removed the 'prompt out of ,netrc and used 'mdel' ..the script works just fine.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Specifying port for ftp when using .netrc

Hi, does anybody know if it is possible to specify a particular port for an FTP address within a .netrc file ? i have a script which opens the ftp to a machine and then instigates .netrc to login etc.. within .netrc i need it to go to a particular port to enable me to automate the dropping of... (2 Replies)
Discussion started by: forefather1977
2 Replies

2. Shell Programming and Scripting

Doubt in .netrc file for ftp login

Hi, i have a doubt. i am using .netrc file for login to a ftp server. ftp abc.ftp.com suppose i have 2 userid and password for the same server as shown below. which one is it going to read from the .netrc file? cat .netrc machine abc.ftp.com login admin1 password pass1 machine... (13 Replies)
Discussion started by: Little
13 Replies

3. Red Hat

FTP issue

Hi everybody, I would like to findout a directory or a file which is located at ftp server by connecting with ftp <ip> by using any other linux utility. I tried with find and locate commands in this manner but didnt work. Please help me. Regards, Mastan (1 Reply)
Discussion started by: mastansaheb
1 Replies

4. UNIX for Dummies Questions & Answers

Performing Batch ftp without .netrc

How can I supply the userID/password when executing FTP in the batch mode? Using .netrc is not an option (prohibited per Corporate Policy). Thank you in advance. (1 Reply)
Discussion started by: compaamat
1 Replies

5. Shell Programming and Scripting

Automating ftp without .netrc

I'm writing a script which needs to run under an 'automation' account and there is already a .netrc machine definition for the server I need to connect to. If I create a new machine entry in the .netrc with a different account this will, of course, be ignored and the ftp session will connect to... (3 Replies)
Discussion started by: DeepakS
3 Replies

6. AIX

.netrc and Automatic ftp problem

Guy's We have two AIX servers Server1 and Server2 and we have created user1 in Server1 and Server2 ... and .netrc file was confiured under /home/user1 with the below line machine server2 login user1 password abc1234567 -rw------- 1 user1 staff 159 Sep 28 2004 .netrc ... (7 Replies)
Discussion started by: ITHelper
7 Replies

7. Shell Programming and Scripting

Automated FTP script using .netrc to multiple FTP servers

Hi all, I'm using the following script to automated ftp files to 1 ftp servers host= /usr/bin/ftp -vi >> $bkplog 2>&1 <<ftp open $host bin cd ${directory} put $files quit ftp and the .netrc file contain machine login abc... (4 Replies)
Discussion started by: varu0612
4 Replies

8. Shell Programming and Scripting


So... I'm trying to script and FTP Backup of some files from openVMS Alpha machine to a Unixware 7 machine. I decided to use .netrc to do all the FTP actions however when I send the nmap command. It pretty much gets ignored while even other things such "ascii", "case" etc.. get respected... (0 Replies)
Discussion started by: thesubmitter
0 Replies

9. AIX

.netrc and ftp

Hello all, I am using a .netrc to automatically access an ftp host. Here is the line I use... machine 412.blank.com login nw\mylogin password ******* when I use this command... ftp 412.blank.com I get... Connected to 412.blank.com. 220 server_7 FTP server (EMC-SNAS: (4 Replies)
Discussion started by: magikalpnoi
4 Replies

10. UNIX for Dummies Questions & Answers

.netrc multiple ftp jobs to same machine

I have an ftp user, which has been setup to run ftp jobs to a specific machine (different jobs). for the first job i created .netrc in the ftp users home directory and added the appropriate commands machine FTPBOX01 login user1 password xxx macdef init etc etc get file bye I use the... (3 Replies)
Discussion started by: hcclnoodles
3 Replies
Login or Register to Ask a Question

Featured Tech Videos