LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   copy whole filesystem via scp ? (http://www.linuxquestions.org/questions/slackware-14/copy-whole-filesystem-via-scp-4175449321/)

WiseDraco 02-09-2013 02:08 PM

copy whole filesystem via scp ?
 
Hello!
Today i try to copy a whole filesystem from old server to directory of new with command like scp -r -s -v 192.168.1.1:/ /second/Old_server
but it stops after another time with last lines like copy TtyS ?
i try to copy another ( data_ disk ) with that manner and too have a stop. i think, it try copy directory like a /lost+found and stuck there. it be can copy whole system on scp? if i remember xorrectly, cp -ax have do it, it has some similar for scp? search over google, not see a solution...

volkerdi 02-09-2013 02:19 PM

The problem is that scp won't handle special files like devices. But something like this will do the trick:

ssh root@192.168.1.1 "(cd / ; tar cf - . )" | (mkdir -p /second/Old_server ; cd /second/Old_server ; tar xvf -)

WiseDraco 02-09-2013 02:21 PM

thanks,ill try it tommorow :)
P.S. and thanks for the slackware - i use it from 4.0, mainly for routers \ servers, but also a 3-4 years also as only desktop system too :) some time i use mandriva / mandrake for desktop, but it's "microsoft way" with glucks, and strange things bored me :)

volkerdi 02-09-2013 05:37 PM

A quick addendum -- you might have to set umask 000 on the receiving end to avoid filtering perms on /tmp and certain files that might be writable by a group. Here's a fixed command line:

ssh root@192.168.1.1 "(cd / ; tar cf - . )" | (mkdir -p /second/Old_server ; cd /second/Old_server ; umask 000 ; tar xvf -)

WiseDraco 02-10-2013 03:25 AM

Thank you very much! looks like working - in that moment files copying, and some hours continued this state * ~250 Gb :) )
with your permission, i want to put that command somewhere in slackware docs ( docs.slackware.com), for others, and even me can find this command when it need next time ;)

volkerdi 02-10-2013 03:56 AM

Quote:

Originally Posted by WiseDraco (Post 4888088)
Thank you very much! looks like working - in that moment files copying, and some hours continued this state * ~250 Gb :) )
with your permission, i want to put that command somewhere in slackware docs ( docs.slackware.com), for others, and even me can find this command when it need next time ;)

Absolutely. Be my guest.

kikinovak 02-10-2013 05:03 AM

Quote:

Originally Posted by WiseDraco (Post 4887789)
Hello!
Today i try to copy a whole filesystem from old server to directory of new with command like scp -r -s -v 192.168.1.1:/ /second/Old_server
but it stops after another time with last lines like copy TtyS ?
i try to copy another ( data_ disk ) with that manner and too have a stop. i think, it try copy directory like a /lost+found and stuck there. it be can copy whole system on scp? if i remember xorrectly, cp -ax have do it, it has some similar for scp? search over google, not see a solution...

I'm not sure if this is exactly what you need, but you might want to have a look at this:

http://sourceforge.net/projects/g4l/

I'm using it in conjunction with a local FTP server. Works great.

WiseDraco 02-10-2013 05:15 AM

Quote:

Originally Posted by kikinovak (Post 4888175)
I'm not sure if this is exactly what you need, but you might want to have a look at this:

http://sourceforge.net/projects/g4l/

I'm using it in conjunction with a local FTP server. Works great.

looks, it is not i want in this case. for backup i some years ago in few places used a backuppc solution - very good, imho.


All times are GMT -5. The time now is 05:18 AM.