External programs: How to - manuelgustavo/qBittorrent GitHub Wiki

You can run external programs on torrent completions. Find the setting under Options > Downloads

Notes

If you're writing a bash script, make sure you make the script executable by using chmod 755 /path/to/script