Hi,
I have a BubbaTwo and another server. The idea here is to copy over all the home directories from BubbaTwo's, where lots of them consists of spaces in the directory name, onto the other server.
I want to make an exact copy of the files, preserve all the file attributes and so on...
Can somebody please give me tips or solution on how to achieve this??
New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !
How to make an identical copy of dirs with spaces?
Re: How to make an identical copy of dirs with spaces?
Hi
use tar
go to the directory from which you wish to copy everything.
tar cvfz /tmp/something.tgz .
everything is now archived and compressed
copy the file over and unpack with
tar xvfz /tmp/something.tgz
use tar
go to the directory from which you wish to copy everything.
tar cvfz /tmp/something.tgz .
everything is now archived and compressed
copy the file over and unpack with
tar xvfz /tmp/something.tgz
cheers
Eek
Eek
Re: How to make an identical copy of dirs with spaces?
I think rsync is the usual way to go, but I have never set it up myself. http://everythinglinux.org/rsync/
Re: How to make an identical copy of dirs with spaces?
Thanks for the answers!
I think I'll try to go with rsync, as I don't have much free space on my BubbaTwo...
I think I'll try to go with rsync, as I don't have much free space on my BubbaTwo...
Re: How to make an identical copy of dirs with spaces?
If this is only a one time shot then Rsync sounds like a waste of time.
I dont know what OS you're using on the receiving end, but a shared folder (samba or nfs) on the receiving end will do. Tar the file to the shared folder according to Eeks instructions. This will not waste any space.
If shared folders are far too lame for you, and you want to be a bit more geek, use netcat.
Make sure you have netcat installed on both units (your bubba and receiving server, windows versions are available)
First, on your server, type:
Second, on your bubba, type:where <folder> is the folder you want to copy, and <host> is the host name (or IP) of your server.
And that's all there is to it, your folder has been piped over the network to the server, without wasting any space.
/Johan
PS If there is one network tool you should know about, it's netcat (aka 'nc'). It can save your day, trust me.
I dont know what OS you're using on the receiving end, but a shared folder (samba or nfs) on the receiving end will do. Tar the file to the shared folder according to Eeks instructions. This will not waste any space.
If shared folders are far too lame for you, and you want to be a bit more geek, use netcat.
Make sure you have netcat installed on both units (your bubba and receiving server, windows versions are available)
First, on your server, type:
Code: Select all
nc -l -p 9999|tar xz
Code: Select all
tar cz <folder>|nc -w 1 <host> 9999
And that's all there is to it, your folder has been piped over the network to the server, without wasting any space.
/Johan
PS If there is one network tool you should know about, it's netcat (aka 'nc'). It can save your day, trust me.
Re: How to make an identical copy of dirs with spaces?
6feet5, thx for the tip - it's working great!
OS: Debian on both Bubba and the other server
OS: Debian on both Bubba and the other server