HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Need some debugging here!
Operating System - HP-UX
1834178
Members
2438
Online
110064
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2002 11:07 AM
04-28-2002 11:07 AM
I wrote the small script attached and am using it to transfer complete directories from one server to another. However, the problem I am encountering is that the subdirectories are being created twice, i.e.
I specify local directory: /home/mad/tst
this one also has within directories tst2 and tst3
Then I specify the remote directory to be: /home/mad
It's creating the following:
/home/mad/tst
/home/mad/tst/tst2
/home/mad/tst/tst3
and also...
/home/mad/tst2
/home/mad/tst3
I desire the first three, but the last two are not what I intended, any idea why those are being created?
I specify local directory: /home/mad/tst
this one also has within directories tst2 and tst3
Then I specify the remote directory to be: /home/mad
It's creating the following:
/home/mad/tst
/home/mad/tst/tst2
/home/mad/tst/tst3
and also...
/home/mad/tst2
/home/mad/tst3
I desire the first three, but the last two are not what I intended, any idea why those are being created?
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2002 11:29 AM
04-28-2002 11:29 AM
Solution
Ok, this is what happened. First of all these dirs will be processed by the for loop ..
1) /home/mad/tst
2) /home/mad/tst/tst2
3) /home/mad/tst/tst3
The first loop will copied "tst" dir and all other dirs under it to $SERVER:/home/mad. So after the 1st for loop, you would have this in $SERVER already ..
/home/mad/tst
/home/mad/tst/tst2
/home/mad/tst/tst3
because it's a recursive copy "-r".
Now going into the 2nd loop, "/home/mad/tst/tst2" directory will be copied over to /home/mad which result in the destination server having ..
/home/mad/tst2
Same argument when it goes into the 3rd loop, which wil result in ..
/home/mad/tst3 be created.
If your goal to to copied everything under /home/mad/tst (including tst) to another server in /home/mad, you don't need the for loop since you've already given the "-r" option in your rcp command.
1) /home/mad/tst
2) /home/mad/tst/tst2
3) /home/mad/tst/tst3
The first loop will copied "tst" dir and all other dirs under it to $SERVER:/home/mad. So after the 1st for loop, you would have this in $SERVER already ..
/home/mad/tst
/home/mad/tst/tst2
/home/mad/tst/tst3
because it's a recursive copy "-r".
Now going into the 2nd loop, "/home/mad/tst/tst2" directory will be copied over to /home/mad which result in the destination server having ..
/home/mad/tst2
Same argument when it goes into the 3rd loop, which wil result in ..
/home/mad/tst3 be created.
If your goal to to copied everything under /home/mad/tst (including tst) to another server in /home/mad, you don't need the for loop since you've already given the "-r" option in your rcp command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2002 11:49 AM
04-28-2002 11:49 AM
Re: Need some debugging here!
Hi,
The reason is that you are using multiple loops here above a recursive copy. The 'for' loop is not necessary there. You can just remove it and use only the rcp -r command. This will copy the subdirectories to the remote hosts.
HTH,
Shiju
The reason is that you are using multiple loops here above a recursive copy. The 'for' loop is not necessary there. You can just remove it and use only the rcp -r command. This will copy the subdirectories to the remote hosts.
HTH,
Shiju
Life is a promise, fulfill it!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2002 12:22 PM
04-28-2002 12:22 PM
Re: Need some debugging here!
Thanks, now it's working the way I wanted it to work!
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP