Copy whole folder


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Copy whole folder
# 1  
Old 11-06-2012
Copy whole folder

hi friend,

i have Xfolder on remote server A
i have local server B

need to whole x folder from A server B .


Thanks in advance,
anshuman
# 2  
Old 11-06-2012
Use "tar" to create an archive, transfer this to another server (via ftp, sftp, scp, ...), then unpack it there. If the archive file is very large it might speed up the process to pack it before via "gzip".

Pack:
Code:
tar -cf - /your/root/path | gzip [-9] > /path/to/file.tar.gz

Unpack:
Code:
gzip -cd /path/to/file.tar.gz | (cd /your/root/path ; tar -xf -)

I hope this helps.

bakunin
# 3  
Old 11-06-2012
If rsync is available to you, it might be the easiest solution.
the command would look like:

Code:
rsync -az src_box:src_path target_path

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to copy files with the same filenames as those in another folder to that same folder?

Hello All A similar question like this was asked before but I need to change part of the question. I've two folders, Folder A contains some image files in 150 subfolders; Folder B contains text files in 350 subfolders. All image files in Folder A have the same filename as the text... (5 Replies)
Discussion started by: chlade
5 Replies

2. UNIX for Dummies Questions & Answers

Copy files to folder.

Hi, I have a folder which contains some files like this. bin.000001 bin.000002 bin.000003 bin.000004 bin.000005 bin.000129 bin.index I want to copy all these files to a new folder except the last files. Please provide some ideas. Please use next time code tags for your code... (6 Replies)
Discussion started by: arijitsaha
6 Replies

3. Shell Programming and Scripting

copy folder and its contents to another folder

Hi experts, I am coming to you with this basic question on copying a folder and its content from one location to another folder using PERL script. This is my requirement. I have a folder AB under /users/myhome I want to copy AB and its contents to /user/workspace. Finally it should... (1 Reply)
Discussion started by: amvarma77
1 Replies

4. UNIX for Dummies Questions & Answers

How to copy files to one folder?

Hi , I have a file like this, i need to trace its path and copy the files from its path to one folder. I need to replace elib.com,melib.com to F:\.Here i need to copy to a folder called image. Please help http://elib.com/SHC/NLNLHB/020001498.pdf ... (4 Replies)
Discussion started by: umapearl
4 Replies

5. Shell Programming and Scripting

Copy only folder structure ?

Hello, I am not sure how feasible is it, but trying to copy/create the folders from one box to another. I dont want to copy the content of folder otherwise it'd be too much of data.. The folder structure is quite complex (in deep hierarchy) and its a big effort manually .. Please... (5 Replies)
Discussion started by: navsha
5 Replies

6. Shell Programming and Scripting

Find all text files in folder and then copy to a new folder

Hi all, *I use Uwin and Cygwin emulator. I´m trying to search for all text files in the current folder (C/Files) and its sub folders using find -depth -name "*.txt" The above command worked for me, but now I would like to copy all found text files to a new folder (C/Files/Text) with ... (4 Replies)
Discussion started by: cgkmal
4 Replies

7. UNIX for Advanced & Expert Users

Auto copy for files from folder to folder upon instant writing

Hello all, I'm trying to accomplish that if a file gets written to folder /path/to/a/ it gets automatically copied into /path/to/b/ the moment its get written. I thought of writing a shell script and cron it that every X amount of minutes it copies these files over but this will not help me... (2 Replies)
Discussion started by: Bashar
2 Replies

8. Shell Programming and Scripting

How to copy Folder with FTP

Dear All, I'm new in Unix System, can you help me about how to copy folder using FTP command. I have folder name "/heru" and I want copy this folder to my windows system. how to copy this folder? and how to copy all file that using 1 extesion to other divice using ftp for example I want... (1 Reply)
Discussion started by: heru_90
1 Replies

9. UNIX for Dummies Questions & Answers

copy folder contents

I need to make a new dir in side the dir lab5 the new dir is called testLab5 without changing directories copy all files from your lab5 directory into your testLab5 directory then i have to without chaning directories and using exactly one command remove all files that start with the... (1 Reply)
Discussion started by: robsk8_99
1 Replies

10. UNIX for Dummies Questions & Answers

copy folder

Dear All , Kindly I need the easy way or methof in order to copy a folder ( large size ) from one server to another thru the network ! I have a Folder on server A , and i need to take it to server B , through the network . can i use rcp ? if yes how ? Thanks (1 Reply)
Discussion started by: tamemi
1 Replies
Login or Register to Ask a Question