[K12OSN] [Maybe OT]

Jim McQuillan jam at mcquil.com
Wed Aug 2 11:52:10 UTC 2006


Sudev,

tar and find should both work fine for you, even with spaces.

Try this:

mkdir /tmp/pngfiles
cd  /path/to/files
find ./ -name '*.png' -exec cp {} /tmp/pngfiles \;
tar czf /tmp/pngfiles.tgz /tmp/pngfiles
scp /tmp/pngfiles.tgz new_machine:/tmp

That will copy all of the .png files to a temporary directory.
Then, it will tar the directory full of files
then, you can send that tarball over to the new system and
unpack it wherever you'd like.

Do this for each type of file you want, and you should be fine.

Jim McQuillan
jam at Ltsp.org



Sudev Barar wrote:
> I have been trying this with no luck so I thought the guru's here may
> have a solution.
>
> I have loads of files on one server and I want to transfer them to a
> new server BUT I want to store each type of file in one directory. So
> on the new server I will have a directory png.files and want to more
> all files from old server to this new server with a flat structure (
> no sub-directories under png.files )
> As the number of files is large "tar" gives up. "locate" and "find"
> have problems with "white spaces" in the file names. The nearest I
> came to solution was with a google search that pointed me to try:
>
> rsync -avzP remote:'`find -iname "*.png"`' /path/to/local/directory
>
> (there is ' and then ` at the beginning that may not render properly
> and reversed order at end of find)
>
> This unfortunately does not run remotely while run on local gives
> output in form of desired listing. "scp" also does not yield anything
> useful.
>
> Thanks for any pointer.
>
> Of course once I am able to over come the basic hassle then I also
> have to try using the update flag to only transfer latest file from
> multitude of directories.
>




More information about the K12OSN mailing list