Compare commits

...

2 Commits

Author SHA1 Message Date
29ae482d46 silly script for testing 2024-06-23 15:43:51 -04:00
fb3eac1901 Tested and working sd-mac and mac-nas 2024-06-23 15:43:38 -04:00
2 changed files with 31 additions and 6 deletions

25
create-dummy-files.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
# Configuration variables
TARGET_DIR="." # Directory where files will be created
FILE_EXTENSIONS=("JPG" "MP4" "DNG") # Array of file extensions
NUM_FILES=25 # Number of files to create for each extension
FILE_SIZE=10000 # Size of each file in bytes
# Function to create a single dummy file
create_dummy_file() {
local file_path="$1"
head -c "$FILE_SIZE" </dev/urandom > "$file_path"
}
# Iterate over each file extension and create the dummy files
for ext in "${FILE_EXTENSIONS[@]}"; do
for ((i=1; i<=NUM_FILES; i++)); do
file_name="dummy_file_${i}.${ext}"
file_path="$TARGET_DIR/$file_name"
create_dummy_file "$file_path"
echo "Created file: $file_path"
done
done
echo "Created $NUM_FILES dummy files for each extension in $TARGET_DIR"

View File

@ -117,19 +117,19 @@ mode_prompt() {
# Create and open Mac folders. # Create and open Mac folders.
create_folders_mac() { create_folders_mac() {
# Check if the parent ingest directory doesn't exist # Check if the parent ingest directory doesn't exist
if [[ ! -d "$MAC_INGEST_PATH}" ]]; then if [[ ! -d "$MAC_INGEST_PATH" ]]; then
echo "Creating ingest folder at $MAC_INGEST_PATH}" echo "Creating ingest folder at $MAC_INGEST_PATH"
# Since the parent doesn't exist, we create it and all children at once # Since the parent doesn't exist, we create it and all children at once
mkdir -p "$MAC_INGEST_PATH}" mkdir -p "$MAC_INGEST_PATH"
# $? is the exit status of the last commmand, with 0 being success # $? is the exit status of the last commmand, with 0 being success
if [[ $? -eq 0 ]]; then if [[ $? -eq 0 ]]; then
echo "Success!" echo "Success!"
else else
echo "Failed to create directory at $MAC_INGEST_PATH}" echo "Failed to create directory at $MAC_INGEST_PATH"
exit 1 exit 1
fi fi
else else
echo "Ingest folder already exists: $MAC_INGEST_PATH}" echo "Ingest folder already exists: $MAC_INGEST_PATH"
fi fi
} }
@ -271,7 +271,7 @@ ingest_nas() {
echo "Press any key to continue..." echo "Press any key to continue..."
read -n 1 -s read -n 1 -s
# Sync /Volumes/voidf1sh/Pictures/Camera Ingest/ with NAS/media/Camera Ingest/ # Sync /Volumes/voidf1sh/Pictures/Camera Ingest/ with NAS/media/Camera Ingest/
rsync -azv --progress "$MAC_INGEST_FOLDER/" "$NAS_MOUNT_POINT${NAS_INGEST_FOLDER[$INGEST_MODE]}/" $dry_run rsync -azv --progress "${MAC_INGEST_FOLDER[$INGEST_MODE]}/" "$NAS_MOUNT_POINT${NAS_INGEST_FOLDER[$INGEST_MODE]}/" $dry_run
# Copy JPG files # Copy JPG files
# jpg_files=("$MAC_INGEST_PATH/JPG/"*.JPG) # jpg_files=("$MAC_INGEST_PATH/JPG/"*.JPG)