You are not logged in.

#1 2011-06-19 09:23:07

mibadt
Member
Registered: 2009-09-25
Posts: 396

Help with multi-thread bash script

Hi,
I would like to simultaneously copy photo files from a memory card (in a card reader) both to internal HDD and external USB HDD, using rsync, in a *single* run (instead of running 2 rsync processes and read the same large data twice).
It's a single core (ATOM 450) netbook, and I'm looking to minimize time and power consumption (netbook will work on internal battery during trip).
Can anybody offer me a solution?

Thanks


Best regards,
Michael Badt

Offline

#2 2011-06-19 10:22:52

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,673
Website

Re: Help with multi-thread bash script

I did this with lame encoding... see my script in the multilame AUR package.  Vote for it if you find it useful tongue

Last edited by graysky (2011-06-19 10:23:27)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2011-06-20 01:44:32

mibadt
Member
Registered: 2009-09-25
Posts: 396

Re: Help with multi-thread bash script

Thanks, I'll look at it.


Best regards,
Michael Badt

Offline

#4 2011-06-20 19:26:42

briest
Member
From: Katowice, PL
Registered: 2006-05-04
Posts: 468

Re: Help with multi-thread bash script

This is not rsync, but I think that paired with find would be simple and robust enough...

tee /dest/ination1 < /sour/ce > /dest/ination2

Offline

#5 2011-07-04 04:30:53

listdata
Member
Registered: 2008-12-23
Posts: 102
Website

Re: Help with multi-thread bash script

mibadt wrote:

Hi,
I would like to simultaneously copy photo files from a memory card (in a card reader) both to internal HDD and external USB HDD, using rsync, in a *single* run (instead of running 2 rsync processes and read the same large data twice).
It's a single core (ATOM 450) netbook, and I'm looking to minimize time and power consumption (netbook will work on internal battery during trip).
Can anybody offer me a solution?

Thanks

Hi mibadt,

AFAIK this is impossible. Rsync generates the deltas between the source(s) and the destination. You have two different destinations to sync to, and want rsync to somehow create a single set of deltas so that it can write it out to the two different destinations!

What you really want to do is just copy the same files from A to B and C, in one process. Creative uses of the tee command (as briest suggested) seems to be the right trick here.

http://en.wikipedia.org/wiki/Tee_(command)
http://www.google.com/search?q=linux+co … stinations

Offline

Board footer

Powered by FluxBB