From 356cc56748e3482b8f0dad71d100cb0574db0f59 Mon Sep 17 00:00:00 2001 From: Dmitri Popov Date: Sat, 17 Mar 2018 13:05:48 +0100 Subject: [PATCH] Better file transfer --- gphoto-backup.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) mode change 100644 => 100755 gphoto-backup.sh diff --git a/gphoto-backup.sh b/gphoto-backup.sh old mode 100644 new mode 100755 index 7de1c90..9a10d51 --- a/gphoto-backup.sh +++ b/gphoto-backup.sh @@ -6,6 +6,7 @@ STORAGE_MOUNT_POINT="/home/pi/BACKUP" # Set the ACT LED to heartbeat sudo sh -c "echo heartbeat > /sys/class/leds/led0/trigger" +# Create the target directory if it doesn't exist if [ ! -d "$STORAGE_MOUNT_POINT" ]; then mkdir $STORAGE_MOUNT_POINT fi @@ -21,12 +22,12 @@ done # Set the ACT LED to blink at 500ms to indicate that the camera has been detected sudo sh -c "echo 500 > /sys/class/leds/led0/delay_on" -# Switch to STORAGE_MOUNT_POINT and create a directory with current date as its name +# Switch to STORAGE_MOUNT_POINT and transfer files from the camera +# Rename the transferred files using the YYYYMMDD-HHMMSS format cd $STORAGE_MOUNT_POINT -gphoto2 --new -# Rename files using ExifTool based on EXIF date and time data -exiftool -r -d %Y%m%d-%H%M%S.%%e "-FileName /sys/class/leds/led0/brightness" + # Shutdown shutdown -h now