Add geotagging
This commit is contained in:
13
backup.sh
13
backup.sh
@@ -5,7 +5,12 @@
|
|||||||
# to install the required packages and configure the system.
|
# to install the required packages and configure the system.
|
||||||
|
|
||||||
# Specify devices and their mount points
|
# Specify devices and their mount points
|
||||||
source config.cfg
|
# and other settings
|
||||||
|
STORAGE_DEV="sda1"
|
||||||
|
STORAGE_MOUNT_POINT="/media/storage"
|
||||||
|
CARD_DEV="sdb1"
|
||||||
|
CARD_MOUNT_POINT="/media/card"
|
||||||
|
GEO_REF="GEO.JPG"
|
||||||
|
|
||||||
# If there is a wpa_supplicant.conf file in the root of the storage device
|
# If there is a wpa_supplicant.conf file in the root of the storage device
|
||||||
# Rename the original config file,
|
# Rename the original config file,
|
||||||
@@ -73,6 +78,12 @@ sudo lsblk > lsblk.log
|
|||||||
# Perform backup using rsync
|
# Perform backup using rsync
|
||||||
rsync -av --exclude "*.id" $CARD_MOUNT_POINT/ $BACKUP_PATH
|
rsync -av --exclude "*.id" $CARD_MOUNT_POINT/ $BACKUP_PATH
|
||||||
|
|
||||||
|
# Geotag photos if the reference photo exists
|
||||||
|
if [ -f "$STORAGE_MOUNT_POINT/$GEO_REF" ]; then
|
||||||
|
cd $STORAGE_MOUNT_POINT
|
||||||
|
exiftool −overwrite_original_in_place -r -tagsFromFile $GEO_REF -gps:all -ext=JPG .
|
||||||
|
fi
|
||||||
|
|
||||||
# Turn off the ACT LED to indicate that the backup is completed
|
# Turn off the ACT LED to indicate that the backup is completed
|
||||||
sudo sh -c "echo 0 > /sys/class/leds/led0/brightness"
|
sudo sh -c "echo 0 > /sys/class/leds/led0/brightness"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user