Hi all
I've recently purchased an Olympus LS10 and was a bit upset because couldn't have a good way of recording the date of the recordings. So I made this script that copies the files to my laptop adding the creation date to the file name. It can probably be improved and so on (someone knows a good way to add metadata to .wav files?), please be free to do it.
best regards, rreis
#!/bin/bash
# transfer_ls10.sh
# writen by rreis@aero.ist.utl.pt 2009.03.14
# Under the GPL v2
#
# Mount a Olympus LX 10 device, copy all wav files to a directory
# adding creation date to their names
#
# Usage:
#
# ./transfer_ls10.sh <mount_point_of_device>
#
# Before usage edit
# savedir=<dir under where files will be saved>
#
# As usual, use at your own risk. For me it works without problem
# your system can be diferent. This is open source, check the code,
# improve it, return it back to the rest
#
# Happy recordings!
#
##################################################################
# mount device
device=$1
checkfile="$device/olyml_tb.dat"
savedir=/home/fuji/audio/recordings
ls10dirprefx="dss_fld"
tmplisting="/tmp/$$tmp"
if [[ -z "$device" ]]; then
echo
echo "WARNING: Specify mount point"
echo
exit -1
fi
# check if it is Olympus LS 10
mount $device
echo "Checking for $checkfile"
if [ ! -e "$checkfile" ]; then
echo
echo "WARNING: It doesn't looks like the Olympus LS 10!"
echo "WARNING: $checkfile not present"
echo "WARNING: ls result"
echo
ls $device
echo
umount $device
exit -1
fi
echo "Device OK. Looks like an Olympus LS 10"
# create dir for saving the transfered files
# if dir already exists don't complain
date=`date +"%Y.%m.%d"`
savedir="$savedir/ls10_$date"
mkdir -p $savedir
# build copy script header
echo "#!/bin/bash" > $tmplisting
echo " " >> $tmplisting
chmod 700 $tmplisting
# get file times and new names
echo "Compiling files on device"
slist="a b c d"
for fld in $slist; do
dr="$device/$ls10dirprefx"$fld
find $dr -name "*.wav" -prune \
-printf "cp -a $dr/%f $savedir/%TY.%Tm.%Td-%TH:%TM.%f \n" \
>> $tmplisting
done
echo "Copying files"
/./$tmplisting
echo "Cleaning up"
rm $tmplisting
cd
umount $device
echo "End"
exit 0