• 1
  • 4
  • 5
  • 6
  • 7
  • 8(current)
Cron for Kodi - Support Thread (formally CronXBMC)
(2017-10-10, 10:31)i3laze Wrote: Great plugin.
Yet absolutely no foolproof on cron expression input. I've crushed the plugin and made in unstartable when set cron to 8 digits, (not 5-6). Please, add try catch.

Thanks for the input. Added and pushed to github. https://github.com/robweber/cronxbmc/issues/13
Reply
Hello,

I was looking for a way to alter my settings.xml skin file on certain days of the year and ran across this thread. I installed this on Matrix and tried to add a job for midnight on Dec. 1 (0 0 1 12 *). Is that not the correct time format? I am getting an error with script.module.dateutil. It seems that if I use any month besides Jan. it gives this error.

Log
Reply
(2021-01-01, 15:31)latts9923 Wrote: Hello,

I was looking for a way to alter my settings.xml skin file on certain days of the year and ran across this thread. I installed this on Matrix and tried to add a job for midnight on Dec. 1 (0 0 1 12 *). Is that not the correct time format? I am getting an error with script.module.dateutil. It seems that if I use any month besides Jan. it gives this error.

Log

Thanks for pointing this out. I was able to recreate it pretty easily, you're right there is some kind of issue with setting the month as part of the expression. The library used to calculate the dates isn't something maintained by me but I'm going to track it down. I made a GitHub issue: https://github.com/robweber/cronxbmc/issues/18
Reply
You betcha...I'm really hoping this will work for what I want to do.
Reply
(2021-01-02, 21:56)latts9923 Wrote: You betcha...I'm really hoping this will work for what I want to do.

I think I have this all sorted out now. There was a bug in the croniter library that didn't calculate certain "end of month" values correctly. I also did some work on the "next run" code to better handle UTC vs local time. Download the latest version 0.1.3 from GitHub and see if that works better for you.
Reply
@robweber

I think that did it! Thanks for the update!

I found an older version (0.0.9) that's compatible with Leia. I'm getting a similar error...log below. Any chance you could provide a Leia version with the same fix or provide the fix that I can apply myself?

log
Reply
(2021-01-05, 01:48)latts9923 Wrote: @robweber

I think that did it! Thanks for the update!

I found an older version (0.0.9) that's compatible with Leia. I'm getting a similar error...log below. Any chance you could provide a Leia version with the same fix or provide the fix that I can apply myself?

log

Updated for Krypton/Leia - https://github.com/robweber/cronxbmc/tree/krypton Note that the version number didn't change.
Reply
Works like a champ! Thanks for the updates!
Reply
Hi Rob,

Im trying to run this script that located in my userdata folder via cron and im getting an error.

It should backup to my USB called /var/media/KODI

 
Quote:#!/bin/bash
#Purpose = Backup Kodi

find -P "/var/media/KODI/" -maxdepth 1 -type f \( -name '*.tar' \) -mtime +5 -exec 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/"
DESDIR=/var/media/KODI/
tar cvf $DESDIR/$FILENAME $SRCDIR

using this command

Quote: <job command="RunScript(/storage/.kodi/userdata/backup.py)" expression="* * * * *" name="backup" show_notification="True"/>

What is going on?
Reply
can this addon be altered to include If the job is missed, run at next startup? I've been working with latts9923  on  a script that automates theme changes which uses cronxbmc to make the change, cronxbmc works great for this...as long as kodi is running...If the timed event happens and kodi is not running (for whatever reason) the job is just simply missed and waits for the next run (which in the case of the script we're working on, a year), can this feature be added to specify during the job creation to run on next startup if missed?
Kodi ver.19.1  Aeon MQ 8 Matrix Mod Windows 10 
Reply
(2021-01-24, 09:23)ed_davidson Wrote: Hi Rob,

Im trying to run this script that located in my userdata folder via cron and im getting an error.

What is going on?

It looks like you named that script "backup.py" but the contents of it are actually a bash script. The command you're using RunScript() won't run that. When you read the description of that command it is for running Python scripts that exist within Kodi as part of an addon. You could try using System.Exec(). I imagine that would work as long as the Kodi application has permission to execute it. Here is a link with more descriptions of the built in functions: https://kodi.wiki/view/List_of_built-in_...ilt-in.27s
 
(2021-01-25, 16:34)Shredder_guitar Wrote: can this addon be altered to include If the job is missed, run at next startup? I've been working with latts9923  on  a script that automates theme changes which uses cronxbmc to make the change, cronxbmc works great for this...as long as kodi is running...If the timed event happens and kodi is not running (for whatever reason) the job is just simply missed and waits for the next run (which in the case of the script we're working on, a year), can this feature be added to specify during the job creation to run on next startup if missed?

 I guess the short answer is "yes it could probably do that". The long answer is that it would take some reconfiguring. In order to tell if something has been skipped the addon will need to keep track of a last run time for each job. On startup it would then use the last run time to find out if the next run value has been missed from the current date. Not a super complex calc by any means but since the last run time isn't currently being stored that would be the first step to completing this. If you think this would help feel free to fill out an Issue on Github for it. https://github.com/robweber/cronxbmc
Reply
@Shredder_guitar - I see you already made an issue in Github. Sorry I should have checked that first. I'll include my notes from above to keep a history on this.
Reply
Thank you sir! Apologies for duel posting- just wanted to make sure this got some visibility. I'll take this to the github page if that is preferable
Kodi ver.19.1  Aeon MQ 8 Matrix Mod Windows 10 
Reply
Hello - I have just installed Cron for Kodi on nexus and i get this error message in the logs. Can this addon be updated for nexus?

2023-02-18 12:14:58.535 T:31616   error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'AttributeError'>
                                                   Error Contents: module 'xbmc' has no attribute 'translatePath'
                                                   Traceback (most recent call last):
                                                     File "D:\Kodi\Kodi - V20 Nexus\portable_data\addons\service.cronxbmc\service.py", line 5, in <module>
                                                       CronService().runProgram()
                                                     File "D:\Kodi\Kodi - V20 Nexus\portable_data\addons\service.cronxbmc\resources\lib\cron\main.py", line 228, in __init__
                                                       self.manager = CronManager()
                                                     File "D:\Kodi\Kodi - V20 Nexus\portable_data\addons\service.cronxbmc\resources\lib\cron\main.py", line 34, in __init__
                                                       self.jobs = self._readCronFile()
                                                     File "D:\Kodi\Kodi - V20 Nexus\portable_data\addons\service.cronxbmc\resources\lib\cron\main.py", line 140, in _readCronFile
                                                       xbmcvfs.mkdir(xbmc.translatePath('special://profile/addon_data/service.cronxbmc/'))
                                                   AttributeError: module 'xbmc' has no attribute 'translatePath'
                                                   -->End of Python script error report<--
Kodi ver.19.1  Aeon MQ 8 Matrix Mod Windows 10 
Reply
  • 1
  • 4
  • 5
  • 6
  • 7
  • 8(current)

Logout Mark Read Team Forum Stats Members Help
Cron for Kodi - Support Thread (formally CronXBMC)1