add sh
This commit is contained in:
26
gen_combined.sh
Normal file
26
gen_combined.sh
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -z "$1" ] || [ -z "$2" ]; then
|
||||
echo "Usage: $0 <md5_file_path> <target_dir>"
|
||||
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
|
||||
Reference in New Issue
Block a user