Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --------------------------------LFTP------------------------------------
- http://torrent-invites.com/seedbox-tutorials/132965-tutorial-auto-sync-seedbox-home-linux-mac-machine-lftp-shell-script.html
- The following instructions explain how to automate LFTP (the fastest and most automated transfer). This can be achieved through a PC, installing Cygwin, a Mac, or Linux.
- To note, I have this look into my completed torrent directory called "LFTP" on my Seedbox, whenever something new is seen, they will be transferred at max bandwidth to my home. Only one instance of this script will run, if it is currently transferring, it creates a lock and will not run again until the current operation has completed.
- For PC
- install cygwin
- * lftp
- * bash
- * cygrunsrv
- * cron
- For Mac
- install LFTP command line
- Create a file called synctorrents.sh, replace all <> with your values
- ..........................................................................................
- #!/bin/bash
- login=<username>
- pass=<password>
- host=<host dns>
- remote_dir=lftp/
- local_dir=/cygdrive/s/lftp<your directory, the S is the drive letter>
- trap "rm -f /tmp/synctorrent.lock" SIGINT SIGTERM
- if [ -e /tmp/synctorrent.lock ]
- then
- echo "Synctorrent is running already."
- exit 1
- else
- touch /tmp/synctorrent.lock
- lftp -u $login,$pass $host << EOF
- set ftp:ssl-allow no
- set mirror:use-pget-n 5
- mirror -c -P5 --log=synctorrents.log $remote_dir $local_dir
- quit
- EOF
- rm -f /tmp/synctorrent.lock
- exit 0
- fi
- ..........................................................................................
- chmod +x synctorrents.sh (gives the script executing privs)
- create a crontab
- 1. $ touch crontab (creates a blank file crontab)
- 2. nano crontab
- 3. */2 * * * * /home/user/synctorrents.sh >> /home/user/sync_cron.log 2>&1 (syncs every 2 min)
- 4. save and exit
- 5. crontab /crontab (points crontab to the file you just made and edited)
- 6. crontab -l (lists crontab, confirm to make sure it is linked correctly)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement