FTP between two UNIX servers


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting FTP between two UNIX servers
# 1  
Old 09-03-2008
Question FTP between two UNIX servers

Hi

I have server A and server B.

On server B the directory is called /tmp/hmp
On server A I want to get the files on server B:/tmp/hmp via FTP. After I have got the files via FTP I have to delete them. In the script below I'm affraid of that I delete files before I get them by ftp.

#!/bin/bash
ftp -in server B<<END_SCRIPT
quote USER abc
quote PASS XXXX
bin
prompt off
cd /tmp/hmp --folder on ftp
lcd /production/hmp --folder on local drive
mget *.*
mdel *.*
bye
END_SCRIPT
# 2  
Old 09-03-2008
Usually ftp clients work serialized so nothing should be deleted before you have transferred them.
You can also just try it out with some dummy files.

Also it's good to post scripts/code with the [ code ] and [ /code ] tags.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. IP Networking

Ftp connectivity between two UNIX servers

Hi All I am having issues using ftp between a solaris 10 server to a HP-UX 11.31 server, but from the solaris server to the hp-ux I am able to ping. This is what I have done so far: in the solaris server: root@MPCRS01 # svcs -a | grep ftp online Jul_26 svc:/network/ftp:default... (12 Replies)
Discussion started by: fretagi
12 Replies

2. Red Hat

RHEL 6 plain telnet & ftp servers

I am being pushed from AIX onto RHEL 6 and after our first 'chuck it on' install, I have a problem. Where is the old (okay insecure) telnet & ftp server? I know that they are probably regarded as archaic now, but the source servers do not have the SSH tools, so I've got to somehow transfer the... (4 Replies)
Discussion started by: rbatte1
4 Replies

3. Shell Programming and Scripting

FTP files modified after a particular date between servers

Hi all, i need to write a shell script to transfer a file modified after a particular date from one server to another. I searched for the related posts in this forum and got hints and snippets for it. i tried the below code ftp serverA user uname pwd lcd to_dir cd from_dir files=$(find... (7 Replies)
Discussion started by: mick_000
7 Replies

4. UNIX for Dummies Questions & Answers

Mail/ftp/web servers, on VIRTUAL!! dedicated server. Also resource usage. Centos 5.

Hi. First of all, would 4 or 5 websites, 1 ftp server (when downloading by someone or a few persons or one, concretize) and one mail server (not many emails, just to sound official and have a nice, spam-free email for myself). Websites with not that many, but some, later more visitors, quite... (0 Replies)
Discussion started by: newn
0 Replies

5. 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=192.168.0.1 /usr/bin/ftp -vi >> $bkplog 2>&1 <<ftp open $host bin cd ${directory} put $files quit ftp and the .netrc file contain machine 192.168.0.1 login abc... (4 Replies)
Discussion started by: varu0612
4 Replies

6. Shell Programming and Scripting

Script ftp multiple servers

Hi guys , i have 1 problem and no find what is the problem...:confused:, and .netrc is configured and correct permissions... REMOTE="/home/user" LISTADO=`cat /root/home/user/LISTADO.txt` MACHINE=$(echo $i|awk 'FS="|" {print $1}') for i in $LISTADO do ftp $MACHINE <<TER passive prompt... (2 Replies)
Discussion started by: Esquizo000
2 Replies

7. Shell Programming and Scripting

unix servers

hi, anyone please explain ab the unix servers thanks in advance Satya (2 Replies)
Discussion started by: Satyak
2 Replies

8. UNIX for Advanced & Expert Users

MVS->Unix FTP : Using chmod as part of FTP.

We are transferring file from mainframes to unix, & in FTP process itself we would like to set access rights for unix machine. Has anyone used chmod command in association with site command in ftp? How it should be used? Thanks in advance. (1 Reply)
Discussion started by: videsh77
1 Replies

9. Shell Programming and Scripting

FTP script to FTP file to UNIX - Solaris

Hello, A couple of times per week, i receive emails notifications when files are available for processing. Currently i read these eamails with a java program and store the attachement on my C: drive and would now like to generate a PC script to send this file name up to UNIX-Solaris and... (3 Replies)
Discussion started by: bobk544
3 Replies

10. Shell Programming and Scripting

ftp to multiple servers

Hi folks. I am writing a ksh ftp script. The problem is, I need to transfer the files to several different servers. Is there a way to close a connection and move on to the next in one script or do I need to write a separate script for each one? Thanks, kristy (2 Replies)
Discussion started by: kristy
2 Replies
Login or Register to Ask a Question