1 #!/bin/bash
2 # 2008-12-04
3 # I dont want to type a lot when copying lots of images to pc
4
5 echo "Please insert CardReader & Card"
6 read WHATEVER
7 echo -n "Enter Directory: "
8 read DIR
9
10 TMP=`mktemp -t sdk_canonencode_.XXXXXXXXXX` || exit 1
11
12 mkdir -p /mnt/net/tweety/mnt/raid/Pictures/"$DIR"
13
14 while [ true ]; do
15 echo ""
16 echo "Mouting Device"
17 mount /dev/sdb1 /mnt/sdb1/ || exit 1
18 cd /mnt/sdb1/dcim/100eos5d
19
20 echo "Copying Files"
21 rsync -h -P --temp-dir=/tmp --recursive . /mnt/net/tweety/mnt/raid/Pictures/"$DIR" || exit 1
22 echo "Setting Acces rights"
23 sleep 2 # time for rsync server to stop
24 chmod -R 740 /mnt/net/tweety/mnt/raid/Pictures/"$DIR"
25 chown -R sdk:sdk /mnt/net/tweety/mnt/raid/Pictures/"$DIR"
26
27 echo "Umounting Device"
28 cd $TMP
29 umount /mnt/sdb1/ || exit 1
30 echo "Please insert next Card or abort with CTRL+C"
31 read WHATEVER
32 done