[K12OSN] [Maybe OT]
Sudev Barar
sbarar at gmail.com
Sun Aug 20 03:58:19 UTC 2006
On 02/08/06, Jim McQuillan <jam at mcquil.com> wrote:
> > 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 )
> > 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.
>
>
> 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.
>
Thanks Jim,
Finally I could do what I want with
find -iname '*.png' -exec cp -u -p {} /tmp/pngfiles \;
preserving time stamp and only copying the updated files And
thereafter rsync the directory from source to target instead of tar
and scp.
--
Regards,
Sudev Barar
More information about the K12OSN
mailing list