If you are an avid seedbox user, here is another option for automatic uploads to google drive.
There are many ways of achieving this, including a cronjob.
I like this option, as it only runs rclone when a torrent completes.
Using inotifywait to watch for file system events, we look out for primarily the ‘move’ event.
When your torrent completes, it moves the completed torrent into the completed folder.
When this event takes place, when then execute rcopy.sh
Setup rclone and scripts
mkdir ~/bin cd ~/bin wget https://downloads.rclone.org/rclone-v1.38-linux-amd64.zip unzup rclone-v1.38-linux-amd64.zip mv rclone*/* .
rscreen.sh
#!/bin/bash -x ScSess=$(screen -ls) if [[ $ScSess == *"No Sockets found"* ]]; then killall -9 rclone rm -rf ~/bin/rcopy.sh.lock screen -dmS rwait ~/bin/rwait.sh else exit fi
rwait.sh
#!/bin/bash -x COMPLETED_TORRENTS=~/private/deluge/completed/ while true; do inotifywait -r -e modify,attrib,move,close_write,create,delete,delete_self $COMPLETED_TORRENTS ~/bin/rcopy.sh done
rcopy.sh
#!/bin/bash -x #!/bin/bash -x COMPLETED_TORRENTS=~/private/deluge/completed/ if [ -f "~/bin/rcopy.sh.lock" ]; then exit else touch ~/bin/rcopy.sh.lock ~/bin/rclone --config=~/.config/rclone/rclone.conf --verbose --transfers=8 copy "$COMPLETED_TORRENTS" "google:/unsorted/" rm -f ~/bin/rcopy.sh.lock fi
Permissions and PATH
Once you have setup the 3 scripts, make them executable
Permissions
chmod +x ~/bin/*
If ~/bin is not in your path, then add it and reload your shell
Edit Path
echo "PATH=~/bin:\$PATH" >> ~/.bashrc source ~/.bashrc
Finally you run the main script in a cronjob
Finalize and run in the background
Screen session
*/1 * * * * /media/sdf1/feeditout/bin/rscreen.sh >/dev/null 2>&1
You can read more about inotifywait and rclone here
https://linux.die.net/man/1/inotifywait
https://rclone.org/