Cron Scheduler

Is there a way to use the cron scheduler available in the app store to trigger an OSMC backup? I know I can do a manual backup or a backup before updates etc. But what script/command is triggered when you click “back up” or when OSMC checks for updates?

After loosing two SD cards on the same day, I would like to setup a automated backup of OSMC keeping only a few recent copies on an external USB key.

While you’re waiting for a response, you might find exactly what you’re looking for in the official Kodi repository. There is an amazing addon called “Backup” in the “Programs” section that has many more advanced features than the built-in backup utility found in “MyOSMC”. One of those features is a timed backup that can run with cron scheduling. You can, of course, also use it to restore a previous backup. I myself have it set to backup my install very late at night every day. I’ve been using it for over three years and it’s saved my backside quite a few times.

yes I know there is one but I thought osmc’s backup was different so never bothered trying it. I would rather use something that is built in if i can, but will try the addon on my test kodi install on my PC.

Can someone explain the difference between the two? If they provide the same function I may start using the one in the kodi repo, since it isn’t platform depended.

Built-in software seems to relay a feeling of comfort to the end-user. Just ask the masses responsible for making Internet Explorer the second most used Windows browser in a software landscape spoiled for choice of better alternatives. However, to my knowledge, the backup utility found in “MyOSMC” functions no differently than the “Backup” Addon. You’ll of course want to wait for confirmation from a developer, but in the end, files is files and Kodi is Kodi. In fact, if you wanted to backup your install data by hand, without any utility at all, you could just simply copy the “.Kodi” folder to another location.

One amendment I’d like to make to that is that sometimes addons contain binary executables that are platform specific. So, any backups that are made should never really be traded with other platform installs. While no one is likely to do otherwise, it bears mentioning.

I just tried it, and it seems it’s a two part process. First to restore advance…xml and then reboot and then the restore continues. If i didn’t do it this way the skin would fail.

I believe it says that it recommends you restore the advance.xml first, allowing you to restore as you like. Over the years, I’ve tried both ways (Sometimes I know that I have nothing special in the advance.xml) and I’ve never had a skin related failure. As always though with anything, your mileage may vary.

Backup addon can be used with OSMC, but the backup file cannot be used with MyOSMC restore.

The Backup addon has a lot more functionality, such as specifying other folders to back up. The MyOSMC backup solution was intended to run just before an update, so doesnt have an independent scheduler.

Well i tried the kodi backup addon and the restore didn’t go as planned, theme settings missing as well as a few addon settings.

OSMC worked perfectly so i just need to figure out what script/command to run and I’ll be set.

Were they theme settings or addon settings you had just changed? A lot of info is stored in guisettings.xml, but that lives in memory rather than on disk, so backing it up and restoring it is tricky.

nope, ive had these settings for a while. The osmc backup restored them with no issues. i tried the addons on windows and it worked for the most part just not on the pi.

So the Backup addon worked perfectly this time. I believe the issue I had was 1.) using the OSMC skin and 2.) Enabling the “Compress Archive” Option.

OSMC skin would display a popup for MYSQL being turned on, on top of the restore prompt after rebooting which caused the restore to not trigger. With the default Kodi skin it still popped up with the MYSQL but the restore continued regardless. Compressing the backup I guess was causing the skin issues in my previous test since it copied to the SD card and then extracted it etc.