- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: help with find
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-08-2007 04:05 AM
06-08-2007 04:05 AM
I am doing a small migration.
Last week I copied all of the data from mounta to mountb. This copy took about 14 hours do to the amount of data.
Now instead of taking 14 hours I would like to run a find command to find files newer then 7 days and copy them from mounta to mountb.
The problem is that my find syntax does not seem to be smart enough to copy them into the correct directory / subdirectory structure.
How can I find files newer then 7 days and make sure that file gets copied into the correct directory.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2007 04:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2007 04:10 AM
06-08-2007 04:10 AM
Re: help with find
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2007 04:16 AM
06-08-2007 04:16 AM
Re: help with find
Regards,
Kaps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2007 04:39 AM
06-08-2007 04:39 AM
Re: help with find
This shell script has received only cursory testing by me, so use with care:
#!/usr/bin/sh
typeset -i MAXAGE=7
typeset SRCMP=/mounta
typeset DSTMP=/mountb
for F in $(find ${SRCMP} -type f -mtime -${MAXAGE} -print)
do
DIRNAME=${F%/*}
BASENAME=${F##*/}
DSTPATH=${DSTMP}${DIRNAME#${SRCMP}}
if [ ! -d ${DSTPATH} ]
then
mkdir -p ${DSTPATH}
echo "*** Created directory ${DSTPATH}"
fi
echo "Copying ${F} to ${DSTPATH}"
cp -p ${F} ${DSTPATH}
done
exit 0
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2007 05:45 AM
06-08-2007 05:45 AM
Re: help with find
Cheers,
Raj.