SFTP Process each File!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting SFTP Process each File!
# 8  
Old 10-24-2011
i don't get it T_T.. I'm just wondering if it's ok for you to send me in details.. because i'm a newbie here.. T_T

THanks,

---------- Post updated at 08:08 PM ---------- Previous update was at 07:59 PM ----------

here's the code i did, i combine your code:

Code:
#!/bin/sh

HOST='123.456.789'
USER='nikki'
PASSWD='password'

DEC_DIR="/home/nikki/test"

ssh ${USER}@${HOST} "ls ${DEC_DIR} | sort -u" > nik.temp
while read line
do
        sftp ${USER}@${HOST} <<-EOF
        cd ${DEC_DIR}
        get $line
        EOF
done <nik.temp
exit

i think it's working now.. THANK YOU VERY MUCH SIR JAYAN AND SIR AHAMED. i'm just wondering if it's ok for the both of you to review my code?

Please advise,
THanks,
# 9  
Old 10-24-2011
The above code is to get the list of files from remote server..

Quote:
i'm going to get the 1.txt only because he is in the top of file and put it into my server 2.
after i process the 1.txt i'm going to process now the 2.txt. and so on and so on..
Where is that code ??
# 10  
Old 10-24-2011
Closed - Double posting is not tolerated!
Continue here:
https://www.unix.com/shell-programmin...e-you-ftp.html
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Monitoring processes in parallel and process log file after process exits

I am writing a script to kick off a process to gather logs on multiple nodes in parallel using "&". These processes create individual log files. Which I would like to filter and convert in CSV format after they are complete. I am facing following issues: 1. Monitor all Processes parallelly.... (5 Replies)
Discussion started by: shunya
5 Replies

2. UNIX for Dummies Questions & Answers

Automate sftp process using script

Hi, guys, I am trying to automate a sftp process using "expect" method (since the key authentication method is disabled in my company network, there is no helping it). In order to try, I type in the command manually: sftp @ > << EOF >cd >ls -l >EOF >Connecting to @servername password: ... (3 Replies)
Discussion started by: warmboy610
3 Replies

3. Shell Programming and Scripting

Using expect command, spawn will not start sftp process

Hi all, I have a script that runs sftp with expect so I can login and send a file in a cronjob. I've installed this on a couple other servers and it has been fine. However, this time on this machine, it seems to be giving me an issue. It won't move past the spawn sftp command and return a... (3 Replies)
Discussion started by: ltyrrell
3 Replies

4. Shell Programming and Scripting

sftp process

Hi, I have written the following bash shell script for Sftp process,I have already configured the OPEN-SSH server settings and the script is working fine , the script moves files from one folder to another folder within the server itself but the issuse is that when it moves the file from one... (1 Reply)
Discussion started by: nks342
1 Replies

5. Shell Programming and Scripting

Perl SFTP, to get, sort and process every file.

Hi All, I'm niks, and i'm a newbie here and newbie also in perl sorry, i'm just wondering how can i get the file from the other hostname using sftp? then after i get it i'm going to sort the file and process it one by one. sorry because i'm a newbie. Thanks, -niks (4 Replies)
Discussion started by: nikki1200
4 Replies

6. UNIX for Dummies Questions & Answers

Archive files that was already sftp'd/process

Hi, I need to modify my archive script to archive only files which is already sftp to the windows. We encounter some issue which the file is already archiving though it is not yet sftp'd to the Windows. Any answers.?Thanks! (1 Reply)
Discussion started by: sonja
1 Replies

7. UNIX Desktop Questions & Answers

polling using sftp process during a specific time period

Hi all, I need to add a process to poll for the files using sftp during the specific time period .How to i add this to the exsiting script. my requirement is to add a process to the below script which has to poll every 5 min from 5 A.M to 12 P.M. How do i do this? ... (1 Reply)
Discussion started by: narasimha123
1 Replies

8. Shell Programming and Scripting

To execute next UNIX command after ending SFTP process.

Hi, I am trying to run a simple UNIX command after i successfully executed SFTP command as shown below. ----------------------------------------- echo 'Step-1' sftp -vvv -b path exit echo 'Step-2' ------------------------------------------ In above script it executes from the 1st... (3 Replies)
Discussion started by: gautamc
3 Replies

9. Windows & DOS: Issues & Discussions

WRQ Reflection SFTP process hangs when run using windows scheduler

Hi I am doing development on .net framework on Win 2003 box. I am scheduling a job using Windows scheduler to kick off SFTP of files from a local directory to a remotre Unix box. I am using WRQ Reflection Multihost v12.0.7 standard edition for this. Here is how we are scheduling the thing.... (0 Replies)
Discussion started by: kapilash
0 Replies

10. Shell Programming and Scripting

Track Sftp process

Hi, I am using sftp in my bash script. I wanted to know whether if there is any way that we can track whether sftp has been successful or not.. Does sftp return any codes? Thanks in adv (9 Replies)
Discussion started by: borncrazy
9 Replies
Login or Register to Ask a Question