System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

how mv data tree up one dir ?

 
SOLVED
Go to solution
Jerry_109
Super Advisor

how mv data tree up one dir ?

HP-UX B.11.31 U ia64 hp server rx7640
#####################################
wanted to cp data :
from host:/app
to host1:/app
####################################

used the following cmd on host :
# /usr/bin/rsync -avz -e ssh --rsync-path=/usr/bin/rsync /app host1:/app
####################################

result was on host1 it now has
host1:/app/app

with all the data under /app/app

How do I move the data so it's only host1:/app
?
4 REPLIES
V. Nyga
Honored Contributor
Solution

Re: how mv data tree up one dir ?

Hi,

cd /app
mv app ../app1
cd /
Anything else in /app ? if no:
rm -r /app
mv app1 app

HTH
Volkmar
*** Say 'Thanks' with Kudos ***
Hein van den Heuvel
Honored Contributor

Re: how mv data tree up one dir ?

On host:

mv /app /app_bad
mv /app_bad/app /
rmdir /app_bad


or

mv /app/app/* /app
rmdir /app/app

I prefer the first because it does not have to deal with individual files.

Hein

Patrick Wallek
Honored Contributor

Re: how mv data tree up one dir ?

You need to put a trailing '/' on your directory names.

# /usr/bin/rsync -avz -e ssh --rsync-path=/usr/bin/rsync /app/ host1:/app/

It makes a big difference. The rsync man page goes into some detail on this difference.
Pete Randall
Outstanding Contributor

Re: how mv data tree up one dir ?

Or remove /app/app amd fix your rsync command:

# /usr/bin/rsync -avz -e ssh --rsync-path=/usr/bin/rsync /app/* host1:/app


Pete

Pete