[Gllug] Resolved: cp real files but not links

David L Neil Mailing list a/c GLLUG at getaroundtoit.co.uk
Wed Feb 25 19:03:43 UTC 2009


John Hearns wrote:
> 2009/2/25 David L Neil Mailing list a/c <GLLUG at getaroundtoit.co.uk>:
>> Is it possible to copy a directory's contents (and sub-directories) to a
>> new location, but only the 'real files' and not any symlinks?

> The default behaviour for rsync is to ignore symlinks.
> So try      rsync ../original/* /copy
> Or something like that - YMMV


Thank you John. Not what I recall, but same behavior/gets the job
done/the old dog learns a new trick!

	rsync -rA old/ new

= rsync in [improved] local copy mode, recursive, preserving ACLs


Also thanks to Hari and David. Attempting to do the job in one move, I
failed to carry the directory structure and ran out of patience... My
best solution using `find` was to first copy everything over to the new
directory and then remove the unwanted links:

	find -P * -type l - print0 | xargs /bin/rm -v `{}`

=find all files that are links and pipe names serially into `rm`

Regards,
=dn
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list