robweber / xbmcbackup

Backup Addon for Kodi
MIT License
107 stars 48 forks source link

Scheduling task doesn't kick #142

Closed mbelang closed 5 years ago

mbelang commented 5 years ago

I configured the Backup scheduling and it never kicks. I selected Every Week on a given day and hour. There is no log leading to a problem with the add-on.

Here is the scheduling section of my settings.xml file with tuesday 00:00 :

    <category id="scheduling" label="30013">
        <setting id="enable_scheduler" type="bool" label="30060" default="false" />
        <setting id="schedule_interval" type="enum" label="30061" lvalues="30079|30072|30073|30074|30075" default="1" enable="eq(-1,true)"/>
        <setting id="schedule_time" type="labelenum" label="30062" values="00:00|01:00|02:00|03:00|04:00|05:00|06:00|07:00|08:00|09:00|10:00|11:00|12:00|13:00|14:00|15:00|16:00|17:00|18:00|19:00|2
0:00|21:00|22:00|23:00" default="00:00" visible="!eq(-1,4)"  enable="eq(-2,true)"/>
        <setting id="day_of_week" type="enum" label="30063" lvalues="30065|30066|30067|30068|30069|30070|30071" default="0" visible="eq(-2,2)"  enable="eq(-3,true)"/>
        <setting id="cron_schedule" type="text" label="30064" default="0 0 * * *" visible="eq(-3,4)"  enable="eq(-4,true)"/>
        <setting id="schedule_miss" type="bool" label="30109" default="false" enable="eq(-5,true)" />
        <setting id="cron_shutdown" type="bool" label="30076" default="false" enable="eq(-6,true)" />
    </category>

Example with wednesday 01:00:

    <category id="scheduling" label="30013">
        <setting id="enable_scheduler" type="bool" label="30060" default="false" />
        <setting id="schedule_interval" type="enum" label="30061" lvalues="30079|30072|30073|30074|30075" default="1" enable="eq(-1,true)"/>
        <setting id="schedule_time" type="labelenum" label="30062" values="00:00|01:00|02:00|03:00|04:00|05:00|06:00|07:00|08:00|09:00|10:00|11:00|12:00|13:00|14:00|15:00|16:00|17:00|18:00|19:00|2
0:00|21:00|22:00|23:00" default="00:00" visible="!eq(-1,4)"  enable="eq(-2,true)"/>
        <setting id="day_of_week" type="enum" label="30063" lvalues="30065|30066|30067|30068|30069|30070|30071" default="0" visible="eq(-2,2)"  enable="eq(-3,true)"/>
        <setting id="cron_schedule" type="text" label="30064" default="0 0 * * *" visible="eq(-3,4)"  enable="eq(-4,true)"/>
        <setting id="schedule_miss" type="bool" label="30109" default="false" enable="eq(-5,true)" />
        <setting id="cron_shutdown" type="bool" label="30076" default="false" enable="eq(-6,true)" />
    </category>

Is it possible that the setting are not saved correctly?

thx

robweber commented 5 years ago

Both files just look like the default settings.xml file from the base directory of the addon. Can you provide the one saved in the userdata/addon_data/ directory? The Kodi wiki has a page explaining where this is on various platforms. Look for a folder with the addon name and then the settings.xml. That file should just be a list of all the settings and their saved values.

mbelang commented 5 years ago

I kinda saw that after the fact lol

<settings>
    <setting id="backup_addon_data" value="true" />
    <setting id="backup_addons" value="true" />
    <setting id="backup_config" value="true" />
    <setting id="backup_custom_dir_1" value="" />
    <setting id="backup_custom_dir_2" value="" />
    <setting id="backup_database" value="true" />
    <setting id="backup_playlists" value="true" />
    <setting id="backup_profiles" value="true" />
    <setting id="backup_rotation" value="4" />
    <setting id="backup_thumbnails" value="false" />
    <setting id="compress_backups" value="true" />
    <setting id="cron_schedule" value="0 0 * * *" />
    <setting id="cron_shutdown" value="false" />
    <setting id="custom_dir_1_enable" value="false" />
    <setting id="custom_dir_2_enable" value="false" />
    <setting id="day_of_week" value="3" />
    <setting id="enable_scheduler" value="true" />
    <setting id="google_drive_id" value="my_key" />
    <setting id="google_drive_secret" value="my_secret" />
    <setting id="progress_mode" value="2" />
    <setting id="remote_path" value="" />
    <setting id="remote_path_2" value="" />
    <setting id="remote_selection" value="3" />
    <setting id="remove_auth_button" value="" />
    <setting id="schedule_interval" value="2" />
    <setting id="schedule_miss" value="true" />
    <setting id="schedule_time" value="01:00" />
</settings>

It works when I trigger it manually though.

robweber commented 5 years ago

When you save the settings there should be a log entry and a Kodi notification (unless silent is enabled). Do you see either of those?

The scheduler depends on a service that runs on startup normally and then checks if its enabled. If the service is disabled (go to Addon Information to check this) it won't run. Another option is just an error in the service, this you'd probably see on system startup. If checking the service doesn't pan out I'd need a debug log (pastebin or other log site link) that captures the Kodi startup, opening the Backup settings, and saving them.

mbelang commented 5 years ago

boot logs

15:17:58.900 T:1735426976  NOTICE: script.xbmcbackup-1.1.2: scheduled backup was missed, doing it now...
15:18:00.920 T:1735426976  NOTICE: script.xbmcbackup-1.1.2: Starting
15:18:00.921 T:1735426976  NOTICE: script.xbmcbackup-1.1.2: Local Dir: /storage/.kodi/
15:18:00.921 T:1735426976  NOTICE: script.xbmcbackup-1.1.2: Remote Dir: 201809251518/
15:18:00.921 T:1735426976  NOTICE: script.xbmcbackup-1.1.2: Mode - Backup
15:18:00.923 T:1735426976  NOTICE: script.xbmcbackup-1.1.2: Creating Files List
15:18:05.559 T:1735426976  NOTICE: script.xbmcbackup-1.1.2: Writing files to: 201809251518/
15:18:05.559 T:1735426976  NOTICE: script.xbmcbackup-1.1.2: Source: /storage/.kodi/
15:18:27.788 T:1735426976  NOTICE: script.xbmcbackup-1.1.2: Writing files to: /Kodi Backup/
15:18:27.788 T:1735426976  NOTICE: script.xbmcbackup-1.1.2: Source: /storage/.kodi/temp/

Maybe next time it will work :man_shrugging:

When I save the settings only thing logged is: 15:26:56.770 T:1859122080 NOTICE: script.xbmcbackup-1.1.2: Starting

No notifications and notifications are enabled.

robweber commented 5 years ago

That startup message definitely shows that the scheduler is starting. It seems to know it missed the scheduled backup. I'll leave this open and see if it will work as expected now.

mbelang commented 5 years ago

Ok after the reboot, the last scheduled backup worked. I don't really know what happen.

Thx for help.

robweber commented 5 years ago

Sounds good. Thanks for the follow-up.