# Function to log messages with timestamp and level log() { local timestamp=$(date +"%Y-%m-%d %H:%M:%S") local level="$1" local message="$2" echo "[$timestamp] [$level] $message" } # Google Drive Relative Path SOURCE_FOLDER="" # S3 Path BUCKET="" DESTINATION_FOLDER="" log "DEBUG" "Copying from SOURCE_FOLDER $SOURCE_FOLDER" log "DEBUG" "Copying to DESTINATION_FOLDER $BUCKET$DESTINATION_FOLDER" # Do transfer log "INFO" "Initiating COPY" rclone copy \ --tpslimit 200 \ --transfers 200 \ --buffer-size 200M \ --checkers 400 \ --s3-upload-cutoff 100M \ --s3-chunk-size 100M \ --s3-upload-concurrency 50 \ gdrive-remote:"${SOURCE_FOLDER}" \ s3-remote:"${BUCKET}${DESTINATION_FOLDER}" \ -P log "INFO" "Transfer complete" # Do checks log "INFO" "Performing checks based on file sizes at source & destination" rclone check \ --tpslimit 200 \ --transfers 200 \ --buffer-size 200M \ --checkers 400 \ --s3-upload-cutoff 100M \ --s3-chunk-size 100M \ --s3-upload-concurrency 50 \ gdrive-remote:"${SOURCE_FOLDER}" \ s3-remote:"${BUCKET}${DESTINATION_FOLDER}" \ -P log "INFO" "Operations complete!"