2011-07-21 08:51:08 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# 2009 Nico Schottelius (nico-nsbin at schottelius.org)
|
|
|
|
#
|
|
|
|
# This file is part of nsbin.
|
|
|
|
#
|
|
|
|
# nsbin is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# nsbin is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with nsbin. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# Synchronise Camera (CF/SD/...) card with a new folder of today's date
|
|
|
|
#
|
|
|
|
|
2012-02-25 01:37:46 +00:00
|
|
|
set -ex
|
2011-07-21 08:51:08 +00:00
|
|
|
|
|
|
|
dev="$1"
|
2013-04-22 10:53:44 +00:00
|
|
|
destbase=~nico/photos
|
2012-02-25 01:37:46 +00:00
|
|
|
dest=$destbase/$(date +%Y%m%d).eingehend
|
2011-07-21 08:51:08 +00:00
|
|
|
mp="/mnt"
|
|
|
|
|
2012-02-25 01:37:46 +00:00
|
|
|
if [ ! -e "$destbase" ]; then
|
|
|
|
echo "base $destbase not existing" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2011-07-21 08:51:08 +00:00
|
|
|
mkdir -p "$dest"
|
2012-02-25 01:37:46 +00:00
|
|
|
sudo mount "$dev" "$mp" -o uid=nico
|
|
|
|
mv -i "$mp/DCIM/"*/* "$dest"
|
|
|
|
sudo umount "$mp"
|
|
|
|
sudo chown -R nico "$dest"
|
2011-07-21 08:51:08 +00:00
|
|
|
su nico -c "cd $dest && renrot IMG_*.*"
|
2013-04-22 10:53:44 +00:00
|
|
|
rm -f $dest/*_orig
|