Activate Rsync from within Kodi Skin

  • Not sure if I'm posting this in the right place but I use Rsync to backup my hard drive to another drive

    Is it possible to initiate rsync from within Kodi?

    Not able to use cron as the hard drive is not always plugged in and so can not happen at a set date/time. At the moment I load Putty via the laptop and enter the code to make it run.

    • Official Post

    Or you could write a script that makes a backup then as just the kodi key map so with a button press kodi runs the script, you could also possibly set a custom action with certain skins.

  • Finally got this set up. Now when I plug the USB in it auto Rsyncs two folders... And even a cheeky little notification when it's all done... Thanks for your help

    Dave


  • Finally got this set up. Now when I plug the USB in it auto Rsyncs two folders... And even a cheeky little notification when it's all done... Thanks for your help

    Dave

    Perhaps you could share what you made for others who find your thread?

  • Here's how I got it working,

    Installed Rsync via the LibreElec Repository from with Kodi

    Then via WinSCP I did this....

    Within this folder I created two files

    Code
    /storage/.config/udev.rules.d


    • USBCopy.rules
    • USBCopy.sh


    USBCopy.rules
    The name/label of the USB drive in this is the very inventive USB_Hard_Drive

    Code
    ACTION=="add", KERNEL=="sd[a-z]1", ENV{ID_FS_LABEL}=="USB_Hard_Drive", RUN+="/storage/.config/udev.rules.d/USBCopy.sh"

    USBCopy.sh
    Had the code wait for 20 seconds while it was mounted, it then displayed a notification to say it was copying the TVShows folder, when done moved on to the Movies folder

    The blue writing is the local folder, the green is the folder on the USB Drive I want the files to go to

    Finally had to make the USBCopy.sh file executable

    Code
    /storage/.config/udev.rules.d/USBCopy.sh

    I then rebooted the computer and when I plugged in the hard drive it began to work. If I have done anything wrong please let me know!