Step1: Go to start Menu and type "Task Scheduler" in search dialogue box.
Task Schedule window will appear.
Step2: In Task scheduler Menu bar go to Action-->create Basic Task.
It will display the "create BasicTask Wizard" window.
Give name(ex.TREUpdate) and description to the schedule.
Click on next button.
Step3: Select one of the options shown to schedule the task.
For example, select daily and click on Next.
Step4: Select start date and time to start this task.
Select synchronize across time zones check box to execute this schedule across time zones.
Click on next button.
Step5: Select Start a Program as Action and press next.
Step6: Browse the location to Java path in the system.
Enter the following line in "Add arguments" text box and click on Next.
-jar <path-of-the-jar-file>
Step7: Click on Finish and the task will be scheduled successfully.
For Ubuntu/Linux Operating System:
Step1: Go to the Terminal and type following command
$ crontab -e
This will open the personal crontab (cron configuration file) if the specified user has permissions to crontab scheduling.
Otherwise it will show an empty crontab with following message.
No crontab for this username - using an empty one.
Then we need to login to root directory and enter above command.
Step2: After Opening cron configuration file to schedule our executable jar add the following line in that configuration file.
In any line we can define one command to run, and the format is quite simple. So the structure is:
minute hour day-of-month mounth day-of-week command
For Example if we want to run the executable jar on everyday 03:15PM then the command will be
07 15 * * * root /usr/bin/java -jar /home/localhost/TreUpdateJar/TreUpdate.jar
Here /usr/bin/java is the path of java installed in the machine,
/home/localhost/TreUpdateJar/TreUpdate.jar is the path of jar file.
Step3: After adding the above command cron configuration file must end with newline.Then press ctrl+q to quit.
It will ask for saving the file.Press y and then press 'enter' key to save file name with crontab.
Don't change the file name.
It will automatically execute the command at scheduled time and our TRE will be updated at the specified scheduled time.