- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: run multiple shell via script to copy file
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
01-21-2024 10:59 PM - last edited on 01-22-2024 08:30 PM by support_s
01-21-2024 10:59 PM - last edited on 01-22-2024 08:30 PM by support_s
run multiple shell via script to copy file
I need to copy 5 file from server to another one, I scheduled this copy by script in cron but I want to parallelize copy opening multiple shell.
What do you think ?
Can you suggest command to invoke a new shell for every file copy without to wait copy ends ? My target is to get 5 shell processes which are copying files.
- Tags:
- Operating System
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2024 10:30 AM - edited 01-22-2024 10:33 AM
01-22-2024 10:30 AM - edited 01-22-2024 10:33 AM
Re: run multiple shell via script to copy file
> [...] copy by script [...]
Actual copy command(s)? (cp? scp? ftp? ...)
> [...] I want to parallelize copy opening multiple shell.
Why, exactly?
> Can you suggest command to invoke a new shell for every file copy
> without to wait copy ends ? [...]
Append an ampersand to your file-copy command? For example, change:
cp source destination
to:
cp source destination &
You might want to consult the documentation for your shell to learn
how to determine when all the background jobs have completed.
(Something you don't need to worry about if the operations are
sequential.)
> What do you think ?
I suspect that you're making a simple job into a compicated job with
little if any benefit.
> [...] I want to parallelize copy opening multiple shell.
Why, exactly?
If there's some communication bottleneck between these servers, then
I would not expect performance to improve much if you try to push more
data through that bottleneck by having multiple processes try to do it
simultaneously. The bottleneck will still be there, no matter how many
processes are fighting over it.
Have you tried manually running these copy operations simultaneously
(in separate interactive shells)? Did you see any real benefit?
> [...] My target is to get 5 shell processes which are copying files.
I wouldn't expect five (or ten) background jobs to cause any special
problems. (Or provide any significant benefit. But only one of us (at
most) knows what you want to achieve by doing this.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 01:21 PM - edited 01-25-2024 01:22 PM
01-25-2024 01:21 PM - edited 01-25-2024 01:22 PM
Re: run multiple shell via script to copy file
>Actual copy command(s)? (cp? scp? ftp? ...)
scp
>Why, exactly?
Oracle exported 5 files by script and immediately I'd like to start scp copy of these files to remote server inside the same export script.
I thought to ease job making to start all the copies in the same time but I think It's the same result if I start copy sequentially.
What do you think ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 05:27 PM
01-25-2024 05:27 PM
Re: run multiple shell via script to copy file
> What do you think ?
If the files are created sequentially, then copying them as they are
created might make sense. The actual benefit would depend on the time
required to create a file, the time required to copy a file, and how
much interference there is between the create and copy operations (how
much copying one file slows creation of the next file).
If creating a file is slower than copying it (and copying a file
doesn't slow creation of the next file much), then I'd expect copying
multiple files to be about as fast as copying one (the last one).
If creating a file is faster than copying it, then I'd worry more
about a communication bottleneck making simultaneous copying no (or not
much) faster than sequential copying.
Knowing nothing about the time needed to do any of these tasks, I'd
need to run the experiment to see how big the benefit might be.
> Append an ampersand [...]
The relevant topic in the shell documentation seems to be "job
control".