-
-
Save sea3pea0/0f31754915805d054d59 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/bin/bash | |
login=login | |
pass=password | |
host=host.com | |
remote_dir=/remote/dir | |
local_dir=/local/dir | |
trap "rm -f /tmp/torrentsync.lock" SIGINT SIGTERM | |
if [ -e /tmp/torrentsync.lock ] | |
then | |
echo "TorrentSync is running already." | |
exit 1 | |
else | |
touch /tmp/torrentsync.lock | |
/usr/bin/lftp -u $login,$pass $host << EOF | |
set ftp:ssl-allow yes | |
set ssl:verify-certificate no | |
set mirror:use-pget-n 5 | |
set xfer:temp-file-name *.!Sync | |
set xfer:use-temp-file yes | |
mirror -c --loop --Remove-source-files -P3 -X *.r?? -X *sample* -X *.jpg -X *.nfo -X *.sfv -X *.txt --no-empty-dirs $remote_dir $local_dir | |
quit | |
EOF | |
# | |
rm -f /tmp/torrentsync.lock | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment