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?

How are you using your Bubba Two or Excito B3? Got pictures? Share here!
Post Reply
Moloko
Posts: 51
Joined: 12 Feb 2010, 00:50

How to make an identical copy of dirs with spaces?

Post by Moloko »

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??
Eek
Posts: 372
Joined: 23 Dec 2007, 03:03
Location: the Netherlands

Re: How to make an identical copy of dirs with spaces?

Post by Eek »

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
cheers
Eek
Kiff
Posts: 48
Joined: 08 Feb 2010, 04:09
Location: Norway
Contact:

Re: How to make an identical copy of dirs with spaces?

Post by Kiff »

I think rsync is the usual way to go, but I have never set it up myself. http://everythinglinux.org/rsync/
Moloko
Posts: 51
Joined: 12 Feb 2010, 00:50

Re: How to make an identical copy of dirs with spaces?

Post by Moloko »

Thanks for the answers!

I think I'll try to go with rsync, as I don't have much free space on my BubbaTwo...
6feet5
Posts: 269
Joined: 13 Apr 2007, 17:32
Location: Gnesta, Sweden
Contact:

Re: How to make an identical copy of dirs with spaces?

Post by 6feet5 »

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:

Code: Select all

nc -l -p 9999|tar xz
Second, on your bubba, type:

Code: Select all

tar cz <folder>|nc -w 1 <host> 9999
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.
Moloko
Posts: 51
Joined: 12 Feb 2010, 00:50

Re: How to make an identical copy of dirs with spaces?

Post by Moloko »

6feet5, thx for the tip - it's working great!

OS: Debian on both Bubba and the other server
Post Reply