Jump to content

luca7

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by luca7

  1. Hello,

     

    I've implemented user scripts in Unraid to automate folder synchronization with Rclone according to a custom schedule. The scripts work effectively, syncing in the background as intended. However, this success comes at a cost: my internet connection, which has limited bandwidth, becomes virtually unusable during sync operations.

     

    To address this, I attempted to create additional scripts to terminate the Rclone sync at scheduled intervals, aiming to restrict internet downtime to nighttime hours. I used the commands

    kill $(ps aux | grep '[r]clone' | awk '{print $2}')

     and

    killall -9 rclone

    both of which execute successfully in the console but fail to work when executed via user scripts. The challenge arises because the process ID (PID) of Rclone changes with each execution, rendering other methods ineffective.

     

    I'm seeking advice on how to dynamically terminate a background process, initiated by a user script, using another scheduled user script. Any insights or solutions to this problem would be greatly appreciated.

     

    Thank you.

     

    EDIT:

    Solved by using this really simple but effective rclone flag: --max-duration=TIME

    For me "4h" marks was the sweet spot. Hope to help someone else in here!

×
×
  • Create New...