- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how to copy/backup subdirectory while retain o...
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
06-25-2006 12:19 AM
06-25-2006 12:19 AM
how to copy/backup subdirectory while retain ownership/symlink/access-rights?
I need to retain all the ownership, permission and symlinks within the subdirectories.
How can I achieve these?
"cp -Rp src tgt" does not achieve this.
Alternatively, I can create a tar file of the entire directory, but it would need similar storage space, not efficient for large filesystems.
Anyone know a fail-safe way of redirect tar output to this target directory?
I am not very familiar with redirection.
Or is there any other better alternative?
I am using HPUX 11.23 on Itanium.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2006 12:41 AM
06-25-2006 12:41 AM
Re: how to copy/backup subdirectory while retain ownership/symlink/access-rights?
This should meet your needs:
# cd srcdir && find . -depth -print | cpio -pudlmv dstdir
If you have largefiles in the source directory, however, you will need to use this method:
# cd srcdir && fbackup -i . -f - | ( cd dstdir && frecover -Xsrf - )
Consult the manpages for more infomration.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2006 01:25 AM
06-25-2006 01:25 AM
Re: how to copy/backup subdirectory while retain ownership/symlink/access-rights?
One other notation for you. It is common for the destination directory (or mountpoint) to be smaller in size than the source directory (or mountpoint) after a successful copy. This is simply because blocks in the destination directory that were once used for files that have subsequently been removed, are not deallocated.
You may wish to verify that your source and destination directories contain an equal number of files at the copy's end. You could also compare the contents of the directories with 'dircmp' [see its manpages for more information].
If you want to be very paranoid, you can compare the checksums of the files in the source and destination directories for equality too. Of course, this could take considerable time. Personally, I have not found, nor regard, this necessary.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2006 03:52 AM
06-25-2006 03:52 AM
Re: how to copy/backup subdirectory while retain ownership/symlink/access-rights?
Tar is also a good solution, just run it as root:
cd srcdir; tar cf - *|(cd target; tar xf - )
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2006 11:46 AM
06-25-2006 11:46 AM
Re: how to copy/backup subdirectory while retain ownership/symlink/access-rights?
Bill Hassell, sysadmin