diff --git a/gen_combined.sh b/gen_combined.sh new file mode 100644 index 0000000..e3cdc34 --- /dev/null +++ b/gen_combined.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +if [ -z "$1" ] || [ -z "$2" ]; then + echo "Usage: $0 " + echo "Example: $0 md5_files/mybackup.md5 /Users/yourname/Backup" + exit 1 +fi + +MD5_PATH="$1" +TARGET_DIR="$2" + +FILENAME=$(basename "$MD5_PATH") + +FILE_BASENAME="${FILENAME%.*}" +COMBINED_FILE="${FILE_BASENAME}.txt" + +mkdir -p "combined_files" + +echo "Running ./rclone check ..." +./rclone check "$MD5_PATH" "$TARGET_DIR" --local-encoding "None" --exclude-from "exclude-list.txt" --checkfile "md5" --combined "combined_files/$COMBINED_FILE" + +if [ $? -eq 0 ]; then + echo "Success: Saved to "combined_files/$COMBINED_FILE"" +else + echo "Note: rclone check finished (return value might be different)" +fi