CumulusUtils: Difference between revisions

m
Line 228: Line 228:


==== Windows: Using the scheduler ====
==== Windows: Using the scheduler ====
< To be filled in >
===== How to create a scheduled task =====
Prior to doing this we need to also create the script that the task will use.
Open notepad or your favourite text editor (preferred use: Notepad++).
 
You can copy paste the below and save as cumulusutils.bat
(It can be a filename of choice but must have extension of .bat, if using windows notepad, underneath the File name: option, will need to set Save as type: option to All Files (*.*). This way when the File name: is set as cumulusutils.bat it will save it as that and not cumulusutils.bat.txt)
====== Batch file code of cumulusutils.bat ======
</br>
REM This batch file script checks for the process CumulusMX.exe is running, if yes, then runs the "cumulusutils.exe", otherwise exit</br>
REM Set the current working session to the folder C:\CumulusMX</br>
  cd\</br>
  cd C:\CumulusMX</br>
REM Check for CumulusMX.exe is running, if yes goto :runutils, otherwise goto :end</br>
  tasklist /FI "IMAGENAME eq CumulusMX.exe" 2>NUL | find /I /N "CumulusMX.exe">NUL</br>
  if "%ERRORLEVEL%"=="0" GOTO runutils</br>
  GOTO end</br>
REM Set as working directory C:\CumulusMX and run cumulusutils.exe in folder C:\CumulusMX\utils\bin, with the desired command or commands as per the wiki</br>
:runutils</br>
  START /D C:\CumulusMX C:\CumulusMX\utils\bin\cumulusutils.exe Website</br>
:end</br>
  exit</br>
 
NOTE: The command shown here is ''Website''. The user can put any command he likes in here (with or without ''Thrifty'') depending on what he wants to achieve. Possibly he has to create multiple tasks (e.g. UserAskedData specifically runs on a higher frequency than website). These commands then require their own batch files.
 
===== Task creation process =====
Within the Task Scheduler Library
#Create “New Task…” (actions pane), or right click middle pane and choose “Create New Task” (not Create Basic Task).
##On the General tab of the new task (General information about the task).
##Set desired name for the Task (Example name CumulusUtils, can also set description if desired).
##Click “Change User or Group…”.
##Type in here the word system (click on “Check Names” if desired, to confirm it is correct and it should then display as SYSTEM in capitals).
##Click OK to use this user account.
##Note in Security options part of the new task creation process it should now state under. When running the task, use the following user account: NT AUTHORITY\SYSTEM <br/>(Convenient reason for this is that when the task runs, it runs is running as system account and so is not seen popping up on screen when it is running.)
##“Configure for:” not required to be changed, can be changed to version of operating system.
#On the Triggers tab of the new task (Setting when and how often the task runs).
##Click on “New”, to create a new launch time and frequency of the task.
##Begin the task: option should default to “On a schedule”, this is the desired option.
##Under the settings section choose “Daily” option.
##Start: date can be left as is, set the desired start time of the task. Set to “12:00:15 am”.</br>(Reason for this setting with 15 second delay is trying not to compete with CumulusMX upload tasks).
##In the advanced part, enable Repeat task every: and choose desired interval.</br>With the option for a duration of: default setting of “1 day” is used.
##Set Stop task if it runs longer than: to “30 minutes” (if the task runs longer than the time set, it is stopped. This applies to the individually triggered task, and not the overall routine of this scheduled task, with it’s repeating trigger times).
##Confirm that the Enabled options is ticked to make active this trigger routine.
#On the Actions tab (Setting what the task is to do).
##Click on “New…” to create a new action.
##Action: should default to “Start a program” this is correct.
##In the Program/Script: part, type the path to the program to run, or click “Browse” to navigate and select the program to run. (example C:\CumulusMX\batch_files\cumulusutils.bat).
#On the Conditions tab (setting other conditions).
##Under Power, untick Start the task only if the computer us on AC power</br>(This then enables the task to start and run even if on battery. It will automatically untick Stop if the computers switches to batter power.)
#On the Settings tab (additional other settings for the task).
##Confirm ticked for Allow task to be run on demand.
##By default Stop the task if it runs longer than: is already ticket and set as 3 days.Change to 1 hour (the behaviour here is the same as instruction 3.f.)
##Confirm ticked for If the running ask does not end when requested, for it to stop.
##Default setting of “Do not start a new instance” Is OK.
#Click on OK down the bottom to complete and commit the creation of this new task.
 
===== Customisation =====
One can also customise/fine tune the task further by exporting it, default export format is XML. Then can edit in favourite text editor and reimport when done. May be useful in particular for fine tuning the repetition times of the task.


== Additional remarks ==
== Additional remarks ==