Posts

Showing posts from January, 2025

script to correct the modification dates on files

It's been discovered that Dropbox bases its file dates on exif data in images, which is bad, because the image exif data is sometimes written by old-style point-n-shoot cameras which may or may not have had their date/time clock set correctly. In my case, I'm too lazy to bother as the UI on those old cameras is awful. Why use an old camera? well the latest polaroid cameras behave like that. Anyway. This script fixes the exif date as well as the file create, modify and open dates. #!/bin/bash # Check if both date and filename are provided if [ -z "$1" ] || [ -z "$2" ]; then   echo "Usage: $0 <date: yyyyMMdd or yyyy-MM-dd> <filename>"   exit 1 fi # Extract and clean inputs DATE=$(echo "$1" | tr -d '[:space:]')  # Trim any spaces FILENAME="$2" # Debug: Display received inputs echo "DEBUG: Received date: '$DATE', Filename: '$FILENAME'" # Check if the date is in a valid format (YYYYMMDD o...