Automatic backup

When did I say that Coreelec had an automatic backup option?

strongly disagree… if there is not implemented “use max X GB for the backups or 10 files (whatever)”, then it is a choice and responsibility of the user.

  1. And of course it is a very bad idea to put backups on the SD with CE, it’s absolutely dumb if anything happens therefore Ive bought a special mini USB flash for the backups where the auto backup would save everyones day.

Let’s give the choice to a user and the demand, not some unexperienced users who even dont care about backups at all. Therefore it’s absolutely Illogical to dismis that acc to “could fill SD”. This argument wouldn’t almost happen for the experienced users who use the backup feature.

Let’s a user decides and the demand.

I thought CE was about users - the reason so many options for what I’m VERY grateful! I’d give you 50 EUR immediately as Ive done recently to another a very useful project.

Can you explain what you need a daily backup for in CE?
I can understand (and have setup) daily backups on my PC, because I work on it, change and edit multiple files, and data loss can result in real work being lost.
With CE you set it up, install all your addons, configure everything the way you like and leave it running. You can create a backup manually and keep using the system.
So even if it fails a month or two down the road, you can install fresh and restore from that backup. I used that method before when setting up new boxes, etc.
I, personally, don’t see a point in frequent periodic backups.

I understand that some users want to have this feature, but for me it would be down the priority list.
CE on S905*/S912 is mostly at a stable point right now and we’re focused on getting CE to run well on the Odroid N2. We do fix issues, but we don’t have the time for features that most people will never use.


Then I apologize and I misunderstood your comment before.

I didn‘t talk about your SD card filled up 100%, but the IO usage at 100% because of read operations due to the scheduled backup.

And my question about what really changes in a typical CE installation remains.
You both seem to have a use case, but I‘m still very sure, you don‘t REALLY need it and you are still an exception.

CE compared to other projects is still a quite small team with limited resources.
What would you like to see more? Support for a new SoC, which would be a benefit for a lot of users, and which was demanded several times in the past, or a modified backup solution, which most users wouldn‘t ever use or need?

I don’t want daily, where I wrote it? I’d set about weekly.

Anything can happen, like me despite the SD was ok… some glitch of the HW SW communication did.

Everyone doesn’t need that till something happens :slight_smile:

@relkai I’ve needed that already, don’t want to wait to need it again and pray :slight_smile:

It’s your decision, I’m grateful for everything but I bet there is a demand for it and it’s very easy for you just to set location, frequency in hours and time to schedule for the frequency, nothing more super needed :slight_smile: A script has already been provided here.

And it can be pretty pointless to backup on the CE SD card if anything happens so the SD usage is not important.

You keep saying, how urgently you need it, but you don‘t answer any questions (see the posts from TheCoolest and me).
You can restore from a quite old backup (several months) without loosing anything.

If you really want a scheduled backup, you don‘t really need an integrated solution or a whole script, but a simple tar command and a single entry in your crontab.
The tar command needed has already been covered several times:

It‘s no rocket science and I expect everyone to be able to implement it.


Yes if its so important then a very simple crontab would offer the functionality and is within the capability of anyone to implement. I did a similar thing when my library autoscrapper stopped working - I built my own simple script and crontab to do the same thing.


Couldn’t this be done just as well via an add-on? In which case it doesn’t need to be left to the team to do, anyone with the skills and motivation can chip in.
I wouldn’t have thought many people would have a use for it, but that’s probably true of most add-ons - we pick and choose what we want.

1 Like

Sure, creating an addon with this functionality would be possible. If someone has the motivation and the knowledge to do it, it could be installed into CE.


I thought it’s obvious that any database changes every day (watched status etc), even some plugins change over time.

but thx for the script
would be useful a script just to put inside “/storage/.config/udev.rules.d” and the magic can be done

If you’ve no time to backup many times, then you purpously leave yourself wide open to problems, and really have no justification for asking the devs to save you from your own laziness

and you never forget anything in your life so no need to automate anything in such a simple life in the jungle, right? :slight_smile:

The only thing I am possibly misunderstanding is why you somehow insist that LibreELEC and CoreELEC are the same. They are not (or they would have the same name, obviously).

With that out of the way, whether including an automatic backup for CoreELEC (since this forum is about CoreELEC) would make the software better or not is a matter of opinion, you think it would, I (for one) think it wouldn’t. So the only thing to do is raise a request ( as I have done for you) and see if the devs agree to it. :thinking:

C‘mon guys, let‘s not point the finger at each other and just try to stay on topic.

1 Like

To start an automatic backup 2 minutes after booting CE (courtesy of gregeeh :grinning:) :

  1. Put this code to /storage/.kodi/userdata/, the last 5 backups are saved:

#Purpose = Backup Kodi

#define your backup-directory


#number of backups, which exists after script has finished = NUM+1
#5 backups to be saved

ls -1tr $DESTDIR/*.tar | head -n -$NUM | xargs rm

TIME=`date +%Y%m%d%H%M%S` # date in backup name.
FILENAME=$TIME.tar # Backup Name
SRCDIR="/storage/.kodi/ /storage/.cache /storage/.config/"


You have to modify the line which defines DESTDIR to fit your needs.

  1. Put this lines to /storage/.config/

#Backup starts 2 minutes after booting
(sleep 120; /storage/.kodi/userdata/ >& /storage/.kodi/userdata/

Hope that helps somebody…

1 Like

Just a comment, every time I do a manual backup to the backup folder, the next backup, backs up that tar file as well, so future backups will get larger & larger.

That’s because it’s part of the /storage partition, too.
I agree with you, that this should be excluded by the backup function, but on the other hand it’s a bad idea to use the default /storage/backup path anyway, because it is lost, when your sd card crashes.
You should change the deafult path to a network location or an attached usb hdd instead.

1 Like

I do realize (honest) that coreelec isn’t libreelec, but why the change in the backup function?
In libreelec backup copies (I think) .config, .cache, .kodi and .ssh.
That’s always been enough for me.

1 Like

Please edit your code to below or no date will be shown in your backup .tar

TIME=`date +%Y%m%d%H%M%S`            # Date in Backup Name.
FILENAME=$TIME.tar    # Backup Name

The confusion probably arises from this . . .

Good to hear that you have found a solution :smile:
@trogggy, CoreELEC backups include .config, .cache and .kodi. I personally haven’t had any issue with that (so far). Is .ssh actually a necessary part of a backup?