Connect to FTP find files and export them to another server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Connect to FTP find files and export them to another server
# 1  
Old 03-25-2014
Question Connect to FTP find files and export them to another server

Hi

I'm trying to make script that will connect to FTP Server than find files that contain word HIGH in name and than export them to another server. Can anyone tell me if something like this is possible?

Thanks Smilie
# 2  
Old 03-25-2014
Yes, it's possible.

What have you tried and where are you having problems?
# 3  
Old 03-26-2014
I tried to connect to FTP with code

Code:
#! /bin/bash

#FTP connection
HOST="ftpconnect.com"
USER="user"
PASSWD="password"


ftp -n $FTP_SRV <<END_SCRIPT
quote USER $HOST
quote PASS $FTP_PSW

quit
END_SCRIPT

but it cant connect. Can anyone help me solve this?
# 4  
Old 03-26-2014
In what way does it not work?
# 5  
Old 03-27-2014
It cant connect to server. Maybe there are some other solution that could be used for connecting to server?

---------- Post updated at 07:22 AM ---------- Previous update was at 05:50 AM ----------

I managed to connect using this code

Code:
ssh user@something.com

I want to when is connected to FTP to copy files from folder /data/*HIGH*.7z (i don't know if this is written correctly. I want to copy all files from data Folder that have word HIGH in name) and copy them to another server.
# 6  
Old 03-27-2014
Quote:
Originally Posted by steve87bg
It can't connect to server.
If the server isn't actually running an FTP server, you won't be able to connect to it with FTP.
Quote:
I managed to connect using this code

Code:
ssh user@something.com

I want to when is connected to FTP to copy files from folder /data/*HIGH*.7z (i don't know if this is written correctly. I want to copy all files from data Folder that have word HIGH in name) and copy them to another server.
If you can connect with ssh, perhaps you can copy with scp:

Code:
scp /data/*HIGH*.7z username@host:/path/to/destination

If you want it to happen passwordlessly, you will need to arrange shared keys in advance, because ssh will not let you force it to read a password from a script.
# 7  
Old 03-28-2014
This isn't working. I'm realy confused now Smilie

Can i somehow make batch file that will do this?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script connect to remote server, not find files and exit only from remote server, but not from scrip

I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
Discussion started by: digioleg54
3 Replies

2. UNIX for Advanced & Expert Users

Connect to database through FTP server

Hi All I need to run a query on a remote database through a shell script. I have the query, I have the script ready. I have the details of the database server I need to connect to. Now my problem here is , the server where I run the shell script is an FTP server. ->I do not have Oracle... (4 Replies)
Discussion started by: sparks
4 Replies

3. Shell Programming and Scripting

Not able to connect to new FTP server

Hi All, We have done new FTB setup. I am not able to to connect to this new target server. Here is the new setup to send files to the FTB : - Login : FTB-TAN-DEV-SAP - Protocol : SFTP - Port : 54322 - Hostname : ftb-dev.apj.hp - Env : DEV - Target ID : 3225 I tried connecting to the... (5 Replies)
Discussion started by: ROCK_PLSQL
5 Replies

4. Shell Programming and Scripting

Find files and upload to FTP Server

HI, I need a script to find new files that created after 6:00 from /home/ugh /demo/conn /UAT/d01 and upload them into ftp server according to system date: Please help me (1 Reply)
Discussion started by: refra
1 Replies

5. UNIX for Advanced & Expert Users

Public key to connect from one ftp server to other server

How to generate public key to connect from one ftp server to other server to use in scripting. (1 Reply)
Discussion started by: sridhardwh
1 Replies

6. Linux

Generate public key to connect from one ftp server to other server

How to generate public key to connect from one ftp server to other server to use in scripting. (0 Replies)
Discussion started by: sridhardwh
0 Replies

7. UNIX for Advanced & Expert Users

Unable to use FTP command to connect from one server to another

Hi, I have two unix servers A and B. from A i am trying to use the ftp command to connect to B but I am getting the "ftp: connect: A remote host refused an attempted connect operation." I checked the following things : 1.) Unix Server details for A and B after running the command uname -a... (3 Replies)
Discussion started by: mick_000
3 Replies

8. Shell Programming and Scripting

How to connect to FTP server which requires SSL authentication?

Hello, I tried searching through lot of threads for a solution but couldn't fetch the exact solution, so I am creating a new thread. I am trying to connect to a FTP server 1) using a simple FTP command, it gives the error : 534 Policy requires SSL. Login failed. 2) using SFTP... (19 Replies)
Discussion started by: amitshete
19 Replies

9. Solaris

Export snoop file from an ftp server to a windows pc

Hi, I have a snoop file that I captured on a solaris machine. I ftp'd it to ftp server. How can I export this snoop file from the solaris machine or the ftp server to a windows PC so I can load it to wireshark and analyze it? Thanks, (6 Replies)
Discussion started by: Pouchie1
6 Replies

10. Shell Programming and Scripting

ftp script not able to connect to ftp server.

I have the following ftp script to get files from a remote location. However, on running the script I find that I am not even able to connect to ftp server. I am able to connect to ftp server using other GUI ftp tools like WS_FTP using the same IP. IP used here is a dummy IP. What can go... (3 Replies)
Discussion started by: gram77
3 Replies
Login or Register to Ask a Question