cp & chown issue.

Taking care of your Linux box.

cp & chown issue.

Postby telenor » Sun Oct 09, 2011 6:23 pm

AOA,

I want to copy large amount of files aproximately more than 20,000 files from one dirctory to another, but it gives me error like:

#cd /opt/appserver/images
#cp * /opt/appserver02/public/images

Argument list is too long

Also abobe mention error appear again when i run:

#cd /opt/appserver/images
#chown root.root *

How can i copies & change owner.
telenor
Havaldaar
 
Posts: 104
Joined: Tue Mar 29, 2005 11:08 am

Re: cp & chown issue.

Postby lambda » Mon Oct 17, 2011 2:20 am

Code: Select all

rsync --inplace -PHvza /opt/appserver/images/* /opt/appserver02/public/images/
Watch out for the Manners Taliban!
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?
lambda
Major General
 
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Website: http://www.hungry.com/~fn/
Location: Lahore

Re: cp & chown issue.

Postby telenor » Thu Oct 27, 2011 1:32 pm

AOA,

I dont want to use RSYNC, i need a script or something like commands just using xargs,find
telenor
Havaldaar
 
Posts: 104
Joined: Tue Mar 29, 2005 11:08 am

Re: cp & chown issue.

Postby nomankhn » Sat Oct 29, 2011 5:44 pm

Senior recommend rsync command, that he recommend it is fine, Why you don't want to use rsync. Do you want us to write script for you?
nomankhn
Colonel
 
Posts: 714
Joined: Wed Aug 07, 2002 8:00 pm

Re: cp & chown issue.

Postby telenor » Mon Oct 31, 2011 10:33 am

AOA,

If possible to write script for me, also combination of xargs (dont rsync) required.
telenor
Havaldaar
 
Posts: 104
Joined: Tue Mar 29, 2005 11:08 am

Re: cp & chown issue.

Postby nomankhn » Sun Nov 06, 2011 6:33 pm

how much you will pay for your homework?
nomankhn
Colonel
 
Posts: 714
Joined: Wed Aug 07, 2002 8:00 pm

Re: cp & chown issue.

Postby mfaisalkh » Fri Nov 11, 2011 4:16 pm

Try this:

ls -l /opt/appserver/images | xargs -i cp -rpf /opt/appserver/images/{} /opt/appserver02/public/images/
mfaisalkh
Havaldaar
 
Posts: 124
Joined: Wed Mar 17, 2004 4:05 pm
Location: Karachi

Re: cp & chown issue.

Postby telenor » Tue Dec 13, 2011 4:24 pm

Again i faced the same problem but now in archiving:

tar -cvf images-13122011.tar /opt/appserver02/public/images

Error is:
Argument list is too long
telenor
Havaldaar
 
Posts: 104
Joined: Tue Mar 29, 2005 11:08 am


Return to “%s” Administration

Who is online

Users browsing this forum: No registered users and 3 guests

cron