- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Using 'find' to send multiple child processes ...
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
02-15-2007 01:50 AM
02-15-2007 01:50 AM
I'm using sh-posix under B.11.11.
I'm trying to come up with a find construct to send multiple child processes to the bg. This will be used for parallel backup of datafiles located anywhere within a directory structure.
Here's what I've tried so far as a test:
# find /u02/oradata/mysid -name '*.dbf' -type f -exec sh -c "sleep 60 &" \;
# ps -f | grep sleep
shows that one sub-process running 'sleep' exists for each .dbf file. So far so good. However, when I try to pass the current path name to -exec, I get the following:
# find /u02/oradata/mysid -name '*.dbf' -type f -exec sh -c "ll {} &" \;
{} not found
{} not found
{} not found
{} not found
{} not found
{} not found
Note that I've tried to accomplish the same thing with '-exec
Ultimately, I would like to copy all .dbf files within a directory structure in parallel, 'wait' for all the child processes to terminate, and then repeat for a new directory structure.
If anyone has any suggestions, I would appreciate reading them.
Thanks,
PCS
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2007 01:54 AM
02-15-2007 01:54 AM
Re: Using 'find' to send multiple child processes to the bg
If this is being done to make things copy faster or involves large files, its likely to work more slowly than a sequential file copy. Head thrashing will probably occur.
Try enclosing the current path in quotes so teh special characters don't confuse find.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2007 01:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2007 02:08 AM
02-15-2007 02:08 AM
Re: Using 'find' to send multiple child processes to the bg
With this particular server/storage combination, it is definitely faster to copy files in parallel.
Pete,
Of course! I was so intent on doing everything within 'find' that I didn't think of using an external loop. Thanks for your insight.
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2007 03:33 PM
02-15-2007 03:33 PM
Re: Using 'find' to send multiple child processes to the bg
>Pete:for FILE in `find /u02/oradata/mysid -name '*.dbf' -type f`; do
You do know you should replace `` by $()?
for FILE in $(find /u02/oradata/mysid -name '*.dbf' -type f); do
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2007 10:16 PM
02-15-2007 10:16 PM
Re: Using 'find' to send multiple child processes to the bg
I *SHOULD*??? When the Posix police come around and insist that I change not only my ingrained habits, but all my old scripts, and indicate that they're willing to pay for all this effort, I'll *THINK* about it.
Pete
Pete