refactor: Rename cleaner.sh and keymanager.sh scripts

Renames 'clean.sh' to 'cleaner.sh' and 'hdb_keymanager.sh' to 'keymanager.sh' for consistency. Updates corresponding file paths in 'packages.conf'.
This commit is contained in:
2025-09-25 16:30:20 +02:00
parent a16b8aa42b
commit 408f2396da
3 changed files with 2 additions and 2 deletions

30
cleaner.sh Normal file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
# Version: 1.1.0
# Check if any arguments were provided
if [ "$#" -eq 0 ]; then
echo "Usage: $0 <retention_days>:<path> [<retention_days>:<path> ...]"
exit 1
fi
# Loop through each argument provided
for ARG in "$@"; do
# Split the argument at the first colon
IFS=':' read -r RETENTION_DAYS TARGET_DIR <<< "$ARG"
# Validate that both a retention period and a path were provided
if [ -z "$RETENTION_DAYS" ] || [ -z "$TARGET_DIR" ]; then
echo "Invalid format for argument: $ARG. Please use the format <retention_days>:<path>"
continue
fi
echo "Starting cleanup of files older than $RETENTION_DAYS days in $TARGET_DIR..."
# Use find to locate and delete files, handling potential errors
find "$TARGET_DIR" -type f -mtime +"$RETENTION_DAYS" -delete -print || echo "Could not process $TARGET_DIR. Check permissions."
echo "Cleanup complete for $TARGET_DIR."
echo "--------------------------------------------------"
done
echo "All cleanup tasks finished."