Basic backup/restore question

  • When using LibreELEC's backup function via GUI I've read that it basically does backup the following folders:

    /storage/.cache

    /storage/.config

    /storage/.kodi

    Since I want to do a scheduled automatic backup onto a remote share via script I'm backing up the following folders via the following command:

    Code
    tar cfv backup.tar /storage/.cache /storage/.config /storage/.kodi /storage/scripts

    As you can see I'm backing up an additional folder called /storage/scripts

    Now my question is: When restoring the backup.tar file via GUI, will the additional folder be restored too or do I have to do it manually?

  • I have made an extended backup script which also stores the /flash/config.txt file.

    The standard Restore Backup from Kodi's GUI menu Settings-LibreELEC-System-Backup works but the /flash/config.txt file is not restored as the /flash folder is mounted as r/o by default.

    I believe it would be useful when the restore part of the official backup-restore script could contain the mount -o remount,rw /flash command before tar command (between lines 33 and 34).

    Edited once, last by ghtester (November 27, 2022 at 10:14 PM).

  • I don't think so, see the post #3. Yes the original backup writes just some folders from parent /storage but if you make your own backup script, it's up to you. But the original restore can't restore to read only folders.

  • I don't think so, see the post #3. Yes the original backup writes just some folders from parent /storage but if you make your own backup script, it's up to you. But the original restore can't restore to read only folders.

    I mean that i think you can only restore to /storage...regarding backup you can backup anything/anywhere you want but I would keep anything out of /storage to backup to a separate .tar just to have a backup and not to use later for restoring purposes..

    edit: looks like we'r saying same thing

  • Yeah, wish config.txt would be stored / restored.

    See this nice example: RE: How to make a backup of kodi?

    So you can make your own backup script which looks like:

    Bash
    #!/bin/sh
    # fullbackup.sh script
    set -e
    tar cf /storage/backup/$(date +%Y%m%d%H%M%S).tar \
      --exclude=Thumbnails --exclude=.thumbnails \
      /storage/.kodi /storage/.cache /storage/.config \
      /storage/.ssh /storage/*.* \
      /storage/picons/  \
      /flash/config.txt /flash/cmdline.txt
    # find /storage/backup -name "*.tar" -type f -mtime +15 -exec rm -f {} \;

    There are some additional folders / files added to be saved, like /storage/picons/ , /storage/*.* , /flash/config.txt and /flash/cmdline.txt .

    For restoring you can use standard Restore Backup from Kodi's GUI menu Settings-LibreELEC-System-Backup

    But currently you need to put the mount -o remount,rw /flash command to SSH console before restoring. Then the /flash/config.txt and /flash/cmdline.txt files should be restored as well.