NFS Backup ?

  • Hi Everyone

    i'm very happy with libreelec on PI its been a great improvement over the firestick.

    Theres only one thing i want too do.

    How can i automate the process of backing up too a NFS share i'm happy with the feature built into libreelec i just want it too auto run every sunday too a NFS share

    Pointers Appretiated

    I tried mount in fstab but the filesystem is read only im pretty new too linux ect so i dont realy have man ideas myself i have also been reading the posts on here but im not undestanding them or the info i need is not there

  • Follow the systemd mount example in /storage/.config/system.d/ to create a local filesystem mount for the remote NFS share, and either mount the share permanently or use cron to start/stop the mount service when needed, and use cron to run a backup script or whatever rsync command you want for backup (rsync will be quicker than a tar based process).

  • Hi Chewitt thanks for the reply

    I have mounted the share decided too use SMB/CIFS as there is already an example in the docs

    there is still some things im unsure of

    how do i permanently mount this share?

    im slightly familiar with cron so should be able too do that

    i would like too use rsync i use it too backup my nas but would be happy with anything that works for now im not sure on scripts either

    hoping for more pointers like i said im new too linux based stuff but im enjoying learning (I took the dive into RPI and linux because of OpenHAB the smart home platform)

    Edited 6 times, last by sharpy (November 2, 2018 at 5:33 PM).

  • Hi Iridium

    i don't have SSH enabled on my NAS so im thinking im best going the script way

    all i need too know now is how do you create a script and how does cron trigger this

  • If you enable SSH on the NAS and install the public SSH key for the HTPC user you can use key-based authentication between HTPC and NAS and there is no need to handle passwords or locally mount remote shares. You can create a backup script on /storage using the nano or vi text editors (via an SSH session). Run "crontab -e" to edit the cron schedules for the root user on the HTPC. There are lots of cron HOWTO's around that describe how to set things up - so I won't spoil the learning experience by doing all the work for you :)

    The main thing to remember with cron is that you need to include the full path to any binaries you execute, e.g. /usr/bin/bash, and the full path to the script that bash will run, e.g. /storage/scripts/backup.sh

  • Backup addon

    I have just installed it and given it a try seems too be a better solution than scripts ect

    Does the backup addon backup the same files/folders as the default LibreELEC backup solution can it backup the entire system

    enable SSH

    Enabling SSH on my NAS voids the warranty/support so i have never enabled it

    Edited once, last by sharpy (November 3, 2018 at 10:20 PM).

  • Which NAS

    Netgear Readynas (not exactly a small manufacturer my model is a basic but they do sell enteprise too)

    on the WebUI when enable SSH get popup

    "NOTE NETGEAR may deny support if you enable root ssh continue YES NO"

    on there site

    ReadyNAS OS 6: SSH access support and configuration guides | Answer | NETGEAR Support

    So form this i have left it turned off im not an advanced user (im skilled with computers/windows & windows programs but i only started linux recently so that makes me a beginner i also don't fancy ruining my nas it houses alot of data (i do have backups but s 12TB restore would take ages)

    from what i have read netgear try too make you too factory reset the device if the know SSH has been enabled they will assume i dont know what im doing and have messed it up

    once factory reset they will support again

    Edited 2 times, last by sharpy (November 4, 2018 at 11:47 AM).

  • You want to do backups to your NAS.

    Yes

    On LibreELEC you set up a NFS mount to a folder on your NAS for one of its users.

    Once the NFS mount on LE properly works, you can do backups of LE folders.

    Done but i used SMB instead of NFS as there was a guide for this LE can send Data too my NAS i used the systemd as posted above.

    The Default LE Backup works too this Share

    i decided on using the Backup addon thats in the Kodi Repo

    my main question now is

    does this backup contain LE settings/docs or is this just kodi files i there a way too add LE files?

  • SMB or NFS, the principle is the same. Once you have your mount running in LibreELEC, you can copy every folder/file you want (LE's user = root) to your NAS.

    Most add-on settings are stored under the .kodi folder, so unless you have some exotic setup, backing up the .kodi / .config / .cache folders should be enough. You can always extend your backup procedure with other folders if necessary.