DIY AUTOMATIC Multiple Card reader for £8.

macro_man

Suspended / Banned
Messages
276
Name
Sharif
Edit My Images
Yes
i have real issue with having to copy my images from the CF cards after a long days shoot. the part that get me is having to start the copy on a card wait for (or not) eject it and then repeat!!:bang:

the obvious solution is then to get a few card readers and start all in 1 go. definitely better but you still need to create the individual folders before dragging and dropping.

the Laziest options would be to write a bash script that will sequentially copy the cards to incremental folder names automatically.

I run ubuntu server on my file store server and i have tested it with multiple usb sticks. It works quite perferctly. so i have ordered 5 cheap CF card readers @£1.6 a piece
I intend to glue them together:naughty:

when you run the script below it ask for a project name and the no. cards copied previously e.g. you have 15 cards to copy but only 5 card readers

While the script below is for non gui linux (ubuntu server), it can be easily adoptable ubuntu desktop, OSX AND in windows with cygwin installed.

Also you will need to install 'usbmount' for automouting of usb devices in the server environment

Linux SCRIPT:-


echo "Please enter your Project name:"
read name
echo Number of cards already copied ('0' for none):
read n

main='/my/projects/folder/' #root to directory where the project will be saved
mkdir $main/$name #make client

var=(`find /media/usb* -name DCIM`) #serachs all dir starting with 'usb' for DCIM exactly and pipes t$
n2=${#var[*]}

if [[ $n2 == '0' ]]; #exit condition
then
echo no DCIM folders found on usb
exit
else
for i in $(find /media/usb* -name DCIM);
do
(( n += 1 ))
echo copying $n of $n2 cards
mkdir /$main/$name/$n/
cp -ra $i/* /$main/$name/$n/
done
fi
 
You'd be more linux-like if you passed command line parameters rather than read them in script. Shells normally populate the variables $1, $2... with the command line parameters ($0 being the command itself).

Also, that script is going to copy sequentially, not in parallel ;) Having said that, it isn't clear to me whether 5 copies in parallel is going to be quicker anyway
 
initially i was going to use '&&' to start the copying in parallel. but realized there was no real advantage since i was writing to a single mechanical disk with on striping but this would be a different story if you had a SSD (?).
+
this is my 1st real effort at shell programming borne out of desperation. i wasn't sure how to incrementally number the individual folders per CF card in the script with parallel copy.

I suppose this way u could potentially have the same no. of card reader as you cards. hook em ALL using usb hubs and away you go.
 
Last edited:
initially i was going to use '&&' to start the copying in parallel. but realized there was no real advantage since i was writing to a single mechanical disk with on striping but this would be a different story if you had a SSD (?).
It would probably be worth at least trying backgrounding. The disk should be far quicker than the readers but throughput will depend on what the speed of the readers are vs the speed of the disk is. Would be worth doing a few experiments (and you only need a single ampersand BTW).

this is my 1st real effort at shell programming borne out of desperation.
Aha. In which case set aside an hour or so and start: http://www.tldp.org/LDP/Bash-Beginners-Guide/html/ I do anything automated through scripts - I far prefer them to GUI tools....
 
It would probably be worth at least trying backgrounding. The disk should be far quicker than the readers but throughput will depend on what the speed of the readers are vs the speed of the disk is. Would be worth doing a few experiments (and you only need a single ampersand BTW).

i am just waiting for the card readers to arrive from china. then will be able to carry out some basic benchmarking with parallel copying. i have 6 usb port on my box so there wont be a bottle neck associated with hubs.
woudnt bg'ing stop the initial prompts for project name...?

Aha. In which case set aside an hour or so and start: http://www.tldp.org/LDP/Bash-Beginners-Guide/html/ I do anything automated through scripts - I far prefer them to GUI tools....

:geek: thats site was my main ref....
 
woudnt bg'ing stop the initial prompts for project name...?
No - the backgrounding applies to the command you apply it to - you'd want to background the cp command within the script.



:geek: thats site was my main ref....
Ahah... Looked quite good from a simple google search.
 
Back
Top