?
Solved

How to move Directories and files between linux systems?

Posted on 2007-12-05
9
Medium Priority
?
1,751 Views
Last Modified: 2013-12-16
Hi,
I am new to Linux administration. I have to transfer a huge directory and its contents from one linux server to another linux manchine. Similar to DOS xcopy command. Please be gentle with me by guiding step by step..;) having a little search i could see many suggestions like SCP, SFTP etc..Dont know whats the common and fast solution to accomplish this.

Thanks for your help
0
Comment
Question by:Basheerpt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 48

Accepted Solution

by:
Tintin earned 500 total points
ID: 20417775
Depends on if you want to preserve all the ownership/group and permissions.  If not, then a simple

scp -rp /path/to/dir user@remoteserver:/some/path

will work, otherwise you can use rsync, eg:

rsync -e ssh -av /path/to/dir user@remoteserver:/some/path

or

tar cf - /path/to/dir | ssh user@remoteserver "tar xvf -"
0
 
LVL 5

Author Comment

by:Basheerpt
ID: 20417793
Thanks, before i give it a try, pls clarify..

Will the first two commands copy all the contents of the floder and preserve folder structures? (including empty)
0
 
LVL 48

Expert Comment

by:Tintin
ID: 20417845
All three commands will copy everything under the folder (including sub-folders, files etc).
0
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 
LVL 5

Author Comment

by:Basheerpt
ID: 20417908
Thanks, I tried the first command to a mounted volume in the target system. Its almost 400 Gb is free there. But, When i try to copy an 80 Gb here, the files started copying after some time gives the error not enough space!

Is there anything have i to do to overcome this?
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 20417948
Hi,

If you have FTP open between the two m/cs you may use:

wget -r -nH ftp://username:userpassword@remotehostname/dir

The above command to pull files

This is faster in transferring files since it does not involve encryption
0
 
LVL 48

Expert Comment

by:Tintin
ID: 20417999
Please post the exact scp command you used and the output of

df  -h

on the remote system.
0
 
LVL 5

Author Comment

by:Basheerpt
ID: 20418067
df -h
File system                  size                 used              avail            used %           mounted on
/dev/sda5                     20G                  20G                  0                 100                      /
none                             16G                     0                  16G                0                   /dev/shm
/dev/sda8                    480G                 105M              456G              1%                /u01

The command I executed from the source machine:
scp -rp /u01/sourcedir root@192.168.1.2:/u01/destdir

It asked me password in the destination server and it passed. It displayed copying files  after little long, it gives the error. As you can see, my /u01 has plenty of space.

Thanks again
                               
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 20418094
Your root file system (/) is full, better to free some logs !
 
0
 
LVL 5

Author Closing Comment

by:Basheerpt
ID: 31678091
When I tried second time, but the same command, it worked perfectly. I used the scp command. But it copied very fast unlike windows! I think i am going to love Linux..;)

Thanks geeks!
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month15 days, 3 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question