From 02fb38fdda48a0f5900981968bf18e5366900ec2 Mon Sep 17 00:00:00 2001 From: Jan Meyer Date: Tue, 28 Apr 2026 10:14:29 +0200 Subject: [PATCH] vault backup: 2026-04-28 10:14:29 --- ...df => 29622724 - Lecture_10_-_compact.pdf} | Bin ...df => 29622724 - Lecture_11_-_compact.pdf} | Bin ...pdf => 29622724 - Lecture_1_-_compact.pdf} | Bin ...pdf => 29622724 - Lecture_2_-_compact.pdf} | Bin ...pdf => 29622724 - Lecture_3_-_compact.pdf} | Bin ...pdf => 29622724 - Lecture_4_-_compact.pdf} | Bin ...pdf => 29622724 - Lecture_5_-_compact.pdf} | Bin ...pdf => 29622724 - Lecture_6_-_compact.pdf} | Bin ...pdf => 29622724 - Lecture_7_-_compact.pdf} | Bin ...pdf => 29622724 - Lecture_8_-_compact.pdf} | Bin ...pdf => 29622724 - Lecture_9_-_compact.pdf} | Bin 30 Library/normalize_name.sh | 18 ++++++++---------- 12 files changed, 8 insertions(+), 10 deletions(-) rename 30 Library/{Lecture_10_-_compact.pdf => 29622724 - Lecture_10_-_compact.pdf} (100%) rename 30 Library/{Lecture_11_-_compact.pdf => 29622724 - Lecture_11_-_compact.pdf} (100%) rename 30 Library/{Lecture_1_-_compact.pdf => 29622724 - Lecture_1_-_compact.pdf} (100%) rename 30 Library/{Lecture_2_-_compact.pdf => 29622724 - Lecture_2_-_compact.pdf} (100%) rename 30 Library/{Lecture_3_-_compact.pdf => 29622724 - Lecture_3_-_compact.pdf} (100%) rename 30 Library/{Lecture_4_-_compact.pdf => 29622724 - Lecture_4_-_compact.pdf} (100%) rename 30 Library/{Lecture_5_-_compact.pdf => 29622724 - Lecture_5_-_compact.pdf} (100%) rename 30 Library/{Lecture_6_-_compact.pdf => 29622724 - Lecture_6_-_compact.pdf} (100%) rename 30 Library/{Lecture_7_-_compact.pdf => 29622724 - Lecture_7_-_compact.pdf} (100%) rename 30 Library/{Lecture_8_-_compact.pdf => 29622724 - Lecture_8_-_compact.pdf} (100%) rename 30 Library/{Lecture_9_-_compact.pdf => 29622724 - Lecture_9_-_compact.pdf} (100%) diff --git a/30 Library/Lecture_10_-_compact.pdf b/30 Library/29622724 - Lecture_10_-_compact.pdf similarity index 100% rename from 30 Library/Lecture_10_-_compact.pdf rename to 30 Library/29622724 - Lecture_10_-_compact.pdf diff --git a/30 Library/Lecture_11_-_compact.pdf b/30 Library/29622724 - Lecture_11_-_compact.pdf similarity index 100% rename from 30 Library/Lecture_11_-_compact.pdf rename to 30 Library/29622724 - Lecture_11_-_compact.pdf diff --git a/30 Library/Lecture_1_-_compact.pdf b/30 Library/29622724 - Lecture_1_-_compact.pdf similarity index 100% rename from 30 Library/Lecture_1_-_compact.pdf rename to 30 Library/29622724 - Lecture_1_-_compact.pdf diff --git a/30 Library/Lecture_2_-_compact.pdf b/30 Library/29622724 - Lecture_2_-_compact.pdf similarity index 100% rename from 30 Library/Lecture_2_-_compact.pdf rename to 30 Library/29622724 - Lecture_2_-_compact.pdf diff --git a/30 Library/Lecture_3_-_compact.pdf b/30 Library/29622724 - Lecture_3_-_compact.pdf similarity index 100% rename from 30 Library/Lecture_3_-_compact.pdf rename to 30 Library/29622724 - Lecture_3_-_compact.pdf diff --git a/30 Library/Lecture_4_-_compact.pdf b/30 Library/29622724 - Lecture_4_-_compact.pdf similarity index 100% rename from 30 Library/Lecture_4_-_compact.pdf rename to 30 Library/29622724 - Lecture_4_-_compact.pdf diff --git a/30 Library/Lecture_5_-_compact.pdf b/30 Library/29622724 - Lecture_5_-_compact.pdf similarity index 100% rename from 30 Library/Lecture_5_-_compact.pdf rename to 30 Library/29622724 - Lecture_5_-_compact.pdf diff --git a/30 Library/Lecture_6_-_compact.pdf b/30 Library/29622724 - Lecture_6_-_compact.pdf similarity index 100% rename from 30 Library/Lecture_6_-_compact.pdf rename to 30 Library/29622724 - Lecture_6_-_compact.pdf diff --git a/30 Library/Lecture_7_-_compact.pdf b/30 Library/29622724 - Lecture_7_-_compact.pdf similarity index 100% rename from 30 Library/Lecture_7_-_compact.pdf rename to 30 Library/29622724 - Lecture_7_-_compact.pdf diff --git a/30 Library/Lecture_8_-_compact.pdf b/30 Library/29622724 - Lecture_8_-_compact.pdf similarity index 100% rename from 30 Library/Lecture_8_-_compact.pdf rename to 30 Library/29622724 - Lecture_8_-_compact.pdf diff --git a/30 Library/Lecture_9_-_compact.pdf b/30 Library/29622724 - Lecture_9_-_compact.pdf similarity index 100% rename from 30 Library/Lecture_9_-_compact.pdf rename to 30 Library/29622724 - Lecture_9_-_compact.pdf diff --git a/30 Library/normalize_name.sh b/30 Library/normalize_name.sh index ebef027..fae3327 100755 --- a/30 Library/normalize_name.sh +++ b/30 Library/normalize_name.sh @@ -1,6 +1,5 @@ #!/bin/bash -# Check if a filename was provided if [ -z "$1" ]; then echo "Usage: $0 " exit 1 @@ -8,29 +7,28 @@ fi TARGET="$1" -# Check if the file actually exists if [ ! -f "$TARGET" ]; then echo "Error: File '$TARGET' not found." exit 1 fi -# Get creation time (%W). -# Note: Returns 0 or '-' if the filesystem doesn't support birth time. +# Extract just the filename (e.g., "Lecture_1.pdf") +# and the directory path (e.g., ".") +FILENAME=$(basename "$TARGET") +DIRNAME=$(dirname "$TARGET") + BTIME=$(stat -c %W "$TARGET") -# Fallback to last modification time (%Y) if birth time is unavailable if [ "$BTIME" -eq 0 ] || [ "$BTIME" == "-" ]; then BTIME=$(stat -c %Y "$TARGET") fi -# Calculate the minute-based timestamp (equivalent to Math.floor(ms / 60000)) -# Since stat returns seconds, we divide by 60. FORMATTED_DATE=$(( BTIME / 60 )) -# Define the new name -NEW_NAME="${FORMATTED_DATE} - ${TARGET}" +# Construct the new name using ONLY the filename, +# then prepend the original directory path +NEW_NAME="${DIRNAME}/${FORMATTED_DATE} - ${FILENAME}" -# Perform the rename mv "$TARGET" "$NEW_NAME" echo "Renamed: '$TARGET' -> '$NEW_NAME'"