User Tools


Scheduling Tasks

Photonic3D has the ability to schedule tasks that run in the background. This feature is not enabled by default, but is easily configured in the `config.properties`.

To turn on this feature you need to add the following line in your `config.properties` ```feature.org.area515.resinprinter.util.cron.CronFeature=true```

Then you need to setup the settings for your cron scheduling feature. The cron scheduling feature allows many independent functions to be scheduled at different times.

   [
      {
         taskName:"any friendly name for task",
         taskClassName:"fully qualified classname of any Callable or Runnable",
         cronString:"Cron string as defined by: https://crontab.guru/",
         taskSettings:"Settings as required by your custom taskClassName"
      },
      {
         taskName:"Show directory listing in Windows every night at 1:15am", 
         taskClassName:"org.area515.resinprinter.actions.osscript.ExecuteNativeOSCommandRunnable", 
         cronString:"15 1 * * *", 
         taskSettings:{
            shellCommands:[
               "cmd", "/c", "dir"
            ]
         }
      },
      {
         taskName:"Install firmware onto 3d printer at 4:05am on the 3rd of January every year"
         taskClassName:"",
         cronString:"5 4 3 1 *",
         taskSettings:{
            shellCommands:[
               "/opt/cwh/os/Linux/armv61/avrdude", "-pMicrocontroller", "-cUploadProtocol", "other params"
            ]
      }
   ]