I had almost lost my all backups on a corrupted microSD so not any backup would have been useful a few days ago Fortunately I had a backup on my notebook.
So would be super useful to have a possibility to:
set auto backup
set a location of the backups
(*not so important
an option to exclude thumbnails (or make 2 backups optionally)
an option to create also a Kodi backup (independent from the operating system for an easier migration across platforms, so maximally 3 kinds of backup, 3 files)
)
a button “create the backups right now” of course too
and have NO worry about anything wrong that could happen any time
What do you think?
edit: not talking about Kodi but about the whole CoreElec as is done by the CE settings of course
added just Kodi backup possibility
It looks like there could be an existing kodi addon to do this:-
I haven’t tried it myself but it looks as though it does what you are looking for. You can specify the backup location, select which file types to backup and run the backup on a schedule.
Is this “Backup” add-on working exactly as the CoreElec backup ?
It’s been years since the last time I’ve used it, but I do remember abandoning it because restoring from a backup never worked reliably for me.
CoreElec backup, on the other hand seems to work perfectly.
but maybe the possible settings could take into account even a creation also a Kodi settings to make a migration to a completely different system easier, so two files could be created acc to the user
From memory , I think you have to force close Kodi when the restore backup is at the end.
I Haven’t used it with CE but that is what i do on Android.
Thanks for the feedback.
I think it’s time to try again that Backup add-on.
I will also keep a CoreElec backup to be on the safe side, before I try with the add-on.
I have seen a big demand about this so here is the full Cron+script automatied solution in my case with (arbitrarily):
excluded thumbnails (you can disable it of course in the script)
every 3rd day at 3:00 AM
saved on USB flash
keeps 50 backups in total
It’s done in 2 seconds because of the excluded thumbnails in this case (around 80MB).
create script backup.sh for backup and save the file to /storage/.kodi/userdata/backup.sh
#!/bin/bash
#Purpose = Backup Kodi
#save this file to /storage/.kodi/userdata/backup.sh
#define your backup-directory
DESTDIR="/var/media/8 GB/kodi_backup/"
#DESTDIR=/storage/backup/
cd "$DESTDIR"
#number of backups, which exists after the script will have been finished = NUM+1
#50 backups to be saved
NUM=49
ls -1tr "$DESTDIR"/*.tar | head -n -$NUM | while read -r i
do
rm "$i"
done
TIME=`date +%Y%m%d%H%M%S` # date in backup name.
FILENAME=$TIME.tar # Backup Name
SRCDIR="/storage/.kodi/ /storage/.cache /storage/.config/"
SRCDIR_EXCLUDE="--exclude=storage/.kodi/userdata/Thumbnails"
tar cvf "$DESTDIR/$FILENAME" $SRCDIR_EXCLUDE $SRCDIR
enable cron in the CoreElec settings
set task for the every 3rd day at 3:00 AM
3a) crontab -e
3b) 00 03 */3 * * /storage/.kodi/userdata/backup.sh
3c) press ctrl+x
3d) y
3e) enter
not sure about a restart, probably not necessary
recommend to delete to recreate thumbnails after backup restore this database: /storage/.kodi/userdata/Database/Textures13.db
Done
Thx to @pepeq and @gregeeh for the script we have started with.
Would be very nice to have this in wiki or even in the backup section GUI.
Hey, I’ve got this script working fine, but for some reason the cron job isn’t running. I’ve set it to run every day at 8pm and the output of crontab -l shows as:
0 0 20 ? * * * /storage/.kodi/userdata/backup.sh
It doesn’t seem to run though, what am I doing wrong? Cron is enabled under coreelec settings.
I have my backup.sh script in /storage/.kodi/userdata/
I added this line to my autostart.sh file
(sleep 20; /storage/.kodi/userdata/backup.sh >& /storage/.kodi/userdata/backup.sh.log)&
but im getting this output in the log file
/storage/.config/autostart.sh: line 35: /storage/.kodi/userdata/backup.sh: not found