sftp multiple files and subdirectories


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers sftp multiple files and subdirectories
# 1  
Old 11-26-2004
sftp multiple files and subdirectories

Hi,

I'm new to using the sftp command prompt within the unix shell (usually I just use an FTP windows program).

I've successfully connected to a remote server from within ssh. I've also been able to copy multiple files using the mget command

e.g. mget *.html

How do I copy all files, including subdirectories and their respective files?

Rob
# 2  
Old 11-26-2004
There are many ways to do this. mget, for example, works for many files types, not just html files. Perderabo, one of UNIX.COM top posters (and a brilliant guy), wrote a program that does this (available on this site).

Neo
# 3  
Old 11-27-2004
If you're using Linux, you might want to give yafc a try. Even though it's no longer actively maintained, it does support recursive get/put/rm/etc...

(the yafc command is "get -r files")

Cheers
ZB
# 4  
Old 11-30-2004
Lightbulb

I had a suggestion given to me to tar the directory (and subdirectories) up and ftp that one file. I think I will go with this option as it sounds much easier.

Thanks for you help
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SFTP Multiple files

Hi :), I am new to Unix and Shell Script I have a urgent requirement, where i am new to shell script and Unix my requirement is I have a files in a folder like sales-prod-India-details.txt sales-prod-japan-details.txt sales-prod-china-details.txt My SFTP server has ... (3 Replies)
Discussion started by: spradeep86
3 Replies

2. Shell Programming and Scripting

Renaming multiple files in sftp server in a get files script

Hi, In sftp script to get files, I have to rename all the files which I am picking. Rename command does not work here. Is there any way to do this? I am using #!/bin/ksh For eg: sftp user@host <<EOF cd /path get *.txt rename *.txt *.txt.done ... (7 Replies)
Discussion started by: jhilmil
7 Replies

3. UNIX for Dummies Questions & Answers

Sftp multiple files in single command

Hi All, I would like to sftp 2 files with a single command. I tried the below options, sftp suer@test13:"/u01/home/oracle/SetDb.sh /u01/home/oracle/.profile" ./ But what actually happens is Fetching /u01/home/oracle/SetDb.sh to /u01/home/oracle/.profile /u01/home/oracle/SetDb.sh ... (3 Replies)
Discussion started by: sid2013
3 Replies

4. Shell Programming and Scripting

Script to find & replace a multiple lines string across multiple php files and subdirectories

Hey guys. I know pratically 0 about Linux, so could anyone please give me instructions on how to accomplish this ? The distro is RedHat 4.1.2 and i need to find and replace a multiple lines string in several php files across subdirectories. So lets say im at root/dir1/dir2/ , when i execute... (12 Replies)
Discussion started by: spfc_dmt
12 Replies

5. UNIX for Dummies Questions & Answers

Help with untarring multiple files from tarred directories and subdirectories

Hi, I want to untar all log files from following tarred directory hierarchy Log_files.tar.gz/subject*.tar.gz/project*/*.log It means there are subject1.tar.gz to subject9.tar.gz and in those tarred subect directories there are project1 - project5 directories and in those directories there... (2 Replies)
Discussion started by: rv_trojan
2 Replies

6. Shell Programming and Scripting

help to upload multiple files through SFTP

Hi Experts, Please help me to write the expect script for uploading multiple files in one shot . Below is my program that I have written. #!/usr/local/bin/expect -f #/home/kulbhushan/sftp_prog.sh # procedure to attempt connecting; result 0 if OK, 1 otherwise proc connect {passw} { expect... (1 Reply)
Discussion started by: kulbhushan
1 Replies

7. Shell Programming and Scripting

Error in concatenating multiple files from subdirectories

I want to concatenate multiple files recursively from sub-directories intoone file in Linux. I saved the following script as script.sh in $HOME/testing1 where I have several subdirectories and .txt files into them. I ran script.sh from the command prompt of $HOME/testing1 as ./script.sh. But it... (3 Replies)
Discussion started by: raj284
3 Replies

8. Shell Programming and Scripting

Problem in concatenating multiple files from subdirectories

I want to concatenate multiple files recursively from sub-directories intoone file in Linux. I saved the following script as script.sh in $HOME/testing1 where I have several subdirectories and .txt files into them. I ran script.sh from the command prompt of $HOME/testing1 as ./script.sh. But it... (3 Replies)
Discussion started by: raj284
3 Replies

9. Shell Programming and Scripting

Compress files as per timestamp in multiple subdirectories

I'd really appreciate if anyone could assist me with this code A directory with multiple subdirectories has multiple files which are timestamp'ed. We need to - compress files as per timestamp - save compressed file/s in the respective folder - delete the source files ============... (2 Replies)
Discussion started by: sreewin7
2 Replies

10. Solaris

how to get multiple files using sftp from a windows server

I need to get multiple files from a windows server to a solaris server using sftp, I tried it but only can get one file at a time ( I'm unable to use a wild card character using sftp) hoe do i do this. any light on this is appreciated. Ram. (3 Replies)
Discussion started by: ramky79
3 Replies
Login or Register to Ask a Question