Small tweaks

This commit is contained in:
Skylar Grant 2024-06-23 12:52:26 -04:00
parent 23c34af92b
commit 3aa130e569
2 changed files with 38 additions and 30 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@ -17,18 +17,25 @@
# Some initial variables to work with # Some initial variables to work with
# Set the date for folder creation # Set the date for folder creation
CURRENT_DATE=$(date +%F) CURRENT_DATE=$(date +%F)
# Paths # Paths
# IMPORTANT: Paths should NEVER have trailing slashes, and ALWAYS have leading slashes # IMPORTANT: Paths should NEVER have trailing slashes, and ALWAYS have leading slashes
# SD card mount point
SD_MOUNT_POINT="/Volumes/NO NAME"
# Camera's path to images # Camera's path to images
SD_SRC_PATH="/DCIM/100MSDCF" SD_SRC_PATH="/DCIM/100MSDCF"
# Where to ingest to on the Mac
MAC_INGEST_PATH="$HOME/Pictures/Camera Ingest/$CURRENT_DATE"
# Where to ingest to on the NAS
NAS_INGEST_PATH="/Camera Ingest/$CURRENT_DATE"
# NAS Network Address # NAS Network Address
NAS_ADDRESS="//GUEST:@192.168.0.2/media" NAS_ADDRESS="//GUEST:@192.168.0.2/media"
# Folder where ingests are stored on the Mac
MAC_INGEST_FOLDER="$HOME/Pictures/Camera Ingest"
# Where to ingest to on the Mac
MAC_INGEST_PATH="$MAC_INGEST_FOLDER/$CURRENT_DATE"
# Folder where ingests are stored on the NAS
NAS_INGEST_FOLDER="/Camera Ingest"
# Where to ingest to on the NAS
NAS_INGEST_PATH="$NAS_INGEST_FOLDER/$CURRENT_DATE"
###################################################################################### ######################################################################################
# Functions # Functions
###################################################################################### ######################################################################################
@ -111,8 +118,6 @@ create_folders_nas() {
clean_sd() { clean_sd() {
# Check if the SD card is mounted # Check if the SD card is mounted
if mount | grep -q "/Volumes/NO NAME"; then if mount | grep -q "/Volumes/NO NAME"; then
# Get the SD Card mount point, this is static though
SD_MOUNT_POINT="/Volumes/NO NAME"
echo "SD Card Mounted at $SD_MOUNT_POINT." echo "SD Card Mounted at $SD_MOUNT_POINT."
else else
echo "ERR: SD Card Not mounted!" echo "ERR: SD Card Not mounted!"
@ -199,33 +204,36 @@ ingest_nas() {
fi fi
create_folders_nas create_folders_nas
echo "Beginning copy..." echo "Beginning copy..."
echo "Syncing ingested images with NAS..."
# Sync /Volumes/voidf1sh/Pictures/Camera Ingest/ with NAS/media/Camera Ingest/
rsync -azv --progress "$MAC_INGEST_FOLDER/"
# Copy JPG files # Copy JPG files
jpg_files=("$MAC_INGEST_PATH/JPG/"*.JPG) # jpg_files=("$MAC_INGEST_PATH/JPG/"*.JPG)
if [[ -f "${jpg_files[0]}" ]]; then # if [[ -f "${jpg_files[0]}" ]]; then
echo "Copying JPGs..." # echo "Copying JPGs..."
rsync -avzc --progress "$MAC_INGEST_PATH/JPG/"*.JPG "$NAS_MOUNT_POINT/$NAS_INGEST_PATH/JPG/" # rsync -avzc --progress "$MAC_INGEST_PATH/JPG/"*.JPG "$NAS_MOUNT_POINT/$NAS_INGEST_PATH/JPG/"
else # else
echo "No JPGs, skipping." # echo "No JPGs, skipping."
fi # fi
# Copy ARW files # # Copy ARW files
arw_files=("$MAC_INGEST_PATH/ARW/"*.ARW) # arw_files=("$MAC_INGEST_PATH/ARW/"*.ARW)
if [[ -f "${arw_files[0]}" ]]; then # if [[ -f "${arw_files[0]}" ]]; then
echo "Copying ARWs..." # echo "Copying ARWs..."
rsync -avzc --progress "$MAC_INGEST_PATH/ARW/"*.ARW "$NAS_MOUNT_POINT/$NAS_INGEST_PATH/ARW/" # rsync -avzc --progress "$MAC_INGEST_PATH/ARW/"*.ARW "$NAS_MOUNT_POINT/$NAS_INGEST_PATH/ARW/"
else # else
echo "No ARWs, skipping." # echo "No ARWs, skipping."
fi # fi
# Copy MP4 files # # Copy MP4 files
mp4_files=("$MAC_INGEST_PATH/MP4/"*.MP4) # mp4_files=("$MAC_INGEST_PATH/MP4/"*.MP4)
if [[ -f "${mp4_files[0]}" ]]; then # if [[ -f "${mp4_files[0]}" ]]; then
echo "Copying MP4s..." # echo "Copying MP4s..."
rsync -avzc --progress "$MAC_INGEST_PATH/MP4/"*.MP4 "$NAS_MOUNT_POINT/$NAS_INGEST_PATH/MP4/" # rsync -avzc --progress "$MAC_INGEST_PATH/MP4/"*.MP4 "$NAS_MOUNT_POINT/$NAS_INGEST_PATH/MP4/"
else # else
echo "No MP4s, skipping." # echo "No MP4s, skipping."
fi # fi
echo "Ingest complete!" echo "Ingest complete!"
open "$NAS_MOUNT_POINT/$NAS_INGEST_PATH" open "$NAS_MOUNT_POINT/$NAS_INGEST_PATH"
} }