When my torrents were downloaded I ran the following script as user server with the corresponding ssh keys:
Code: Select all
#!/bin/bash
# Log file
LOG_FILE=/home/server/Downloads/move.log
echo $(date +%Y-%m-%d\ %H:%M:%S) >> $LOG_FILE
echo "***Running move.sh***" >> $LOG_FILE
cd "/home/server/Downloads"
find . -type f | while IFS= read filename; do # Look for files in all ~/Downloads sub-dirs
case "${filename,,*}" in # this syntax emits the value in lowercase: ${var,,*}
*.part) : ;; # Excludes *.part files from being moved
*.resume) : ;;
*.torrent) : ;;
*.trashinfo) : ;;
move.sh) : ;;
# Include
*document*) scp "$filename" "imac@imac.local:/users/imac/Documents/" && rm "$filename" && echo "$filename moved and deleted" >> $LOG_FILE;;
# Else
*) echo "Don't know where to put $filename" >> $LOG_FILE;;
esac
done
How can I fix this problem?
Thanks!
Edit: I think I should have posted on Support. Sorry, my first post here.