- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Copy directory while preserving modification time.
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
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
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
05-18-2006 07:13 AM
05-18-2006 07:13 AM
I would like to make a duplicate copy of this dir structure while preserving original modification times of all files and subdirectories underneath it.
I tried this command but didn’t preserve the mtime.
#cp –r /psoft /psoftold (changes the modification time)
Thanks,
Gulam
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2006 07:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2006 08:13 AM
05-18-2006 08:13 AM
Re: Copy directory while preserving modification time.
cd /psoft
find . | cpio -pudlmv /psoftold
This is the fastest way to copy lots of files. Note that both tar and cpio will not handle large files (files larger than 2Gb) so the cp command would be needed in that case. To see whether there may be largefiles in this directory, use this command:
fsadm /psoft
(this assumes that the /psoft directory is a VxFS filesystem).
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2006 06:30 PM
05-18-2006 06:30 PM
Re: Copy directory while preserving modification time.
Duplicate a directory hierarchy:
# cd olddir
# find . -depth -print | cpio -pdm newdir
More information: man cpio
rgs,
ran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2006 06:37 PM
05-18-2006 06:37 PM
Re: Copy directory while preserving modification time.
use cp -p option it will preserve the Permissions & time stamp too...
You can also use tar&cpio but that limitation is u cannot take a copy of files more than 2 Gb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2006 06:37 PM
05-18-2006 06:37 PM
Re: Copy directory while preserving modification time.
use cp -p option it will preserve the Permissions & time stamp too...
You can also use tar&cpio but that limitation is u cannot take a copy of files having size more than 2 Gb