BinsonBuzz / unraid_rclone_mount

scripts to create rclone mounts on gdrive
288 stars 71 forks source link

Update rclone_upload for Discord Notification #9

Closed watchmeexplode5 closed 4 years ago

watchmeexplode5 commented 4 years ago

Discord notification added.... Modified from the work done by SenpaiBox and no5tyle's code to work with DZMM's scripts. Omitted error reporting because I couldn't get the output in my logs (no5tyle noted needing some flag like "2>&1" in the rclone command but even with that addition I couldn't get proper error reporting via scripting so I scrapped the error reporting all together).

Probably room for improvement with more info in the notification such as file name (hopefully somebody smarter than me can add this easily!), but currently will notify on upload, transfer amount, rate, ect.

Script will NOT notify if transfer = 0 so you can keep the script running at X intervals without flooding your discord.

While implementing I added a log file location (fairly sure the notifications need this). Created a default option to scrub logs at the end of a successful upload to prevent logs from slowly growing.

Added --use-mmap flag. Not sure how beneficial but rclone mods suggested it might be more friendly/optimized use of memory.

Feel free to edit, improve, scrap as needed!

-Watch

jrdnlc commented 4 years ago

You beat me to it! Will try to mess with the error reporting notification and see if I can get that to work

watchmeexplode5 commented 4 years ago

Yeah, thought I'd entertain myself for the evening haha. Let me know if you get error reporting fixed. Also file names would be amazing if you can get that working!

Made my first discord server tonight and I think I'll switch all my notifications over to it now, kinda got addicted 👍