Hi Suresh,
On 11/10/2010 12:08 PM, Suresh Kumar wrote:
Hi
i want to copy files and directory which are on the same server, in between
i want to exclude some directories and subdirectories
cp -pvr /var/www/vhosts/dev.site.com/httpdocs/* /var/www/vhosts/
new.site.com/httpdocs/
but exclude the folders and subfolders in WZ directory
If the files you need to exclude cannot be expressed as a simple shell glob, I
would use something like:
find <src> -name "[pattern]" -o -name "[pattern]" -exec cp {} <dest> \;
or something like:
cp -r `find <src> | egrep -v "(patterns|to|exclude)"` <dest>
However, if this is something you do regularly, I'd suggest using rsync instead.
Do a man rsync and check opts like --exclude.
cheers,
- steve
--
random spiel: http://lonetwin.net/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc