Kill All RClone Instances except mounts

I frequently find myself needing the bandwidth taken up by rclone copy, move, or sync, for a full blu-ray video. As such, I have put together a little script that I can run from my phone’s ssh:

ps -ef | grep "rclone" | grep -v 'grep' | grep -v 'mount' | awk '{ print $2 }' | xargs kill

Single line, kills all rclone instances that do not have the word ‘mount’ in them. This way I do not interfere with any currently playing media. Very efficient.

Thought I’d share.

1 Like

Nice!

You can replace this bit with pgrep -a rclone if you want to shorten it a bit.