Evènements Déclencheurs

Les Events vous permettent d'indiquer à Jarvis ce qu'il doit surveiller et comment vous informer spontanément d'informations ou d'évènements particuliers.

Vous pouvez définir des évènements en sélectionnant Events depuis le menu principal.

Jarvis utilise crontab pour planifier la surveillance et les notifications. Cliquez ici pour en savoir plus sur les tâches Cron.

# Jarvis Events
# Add your events according to format at bottom
# Remove the leading # to enable a rule
# Format:
# Minutes Hours DayofMth Months DaysofWk Command to execute
# 
# Amounts formats: * (all), */2 (every 2), 1,2 (1 and 2), 1-3 (from 1 to 3)
# Shortcuts: @reboot, @yearly, @annually, @monthly, @weekly, @daily    , @midnight, @hourly
#
#                                                 LEGEND
#    ____________________________________________ Minutes (0-59)
#   |        ____________________________________ Hours (0-23)
#   |       |        ____________________________ Days of Month (1-31)
#   |       |       |        ____________________ Months (1-12)
#   |       |       |       |        ____________ Days of Week (0-6, 0 is Sun)
#   |       |       |       |       |         ___ Command to execute
#___|_______|_______|_______|_______|________|_________________________________
#                            Examples
#---|-------|-------|-------|-------|--------|---------------------------------
#   0       0       1,15    *       *       echo "On 1st and 15th of every month at 0am"
#   30      6       *       *       1-5     echo "Every weekday at 6h30"
#   */10    *       *       *       *       echo "Every 10 mins"
#   0       8       30      7       *       echo "On July 30th at 8h"
#   @reboot                                 echo "At system startup"
#___|_______|_______|_______|_______|________|_________________________________
#            Your events below (Remove leading # to enable)
#---|-------|-------|-------|-------|--------|---------------------------------
    @reboot                                 ~/jarvis/jarvis.sh -b
    0       8       *       *       *       ~/jarvis/jarvis.sh -x "quelle est la météo?" # needs weather plugin
    0       7-21    *       *       *       ~/jarvis/jarvis.sh -x "quelle heure est-il?" # needs time plugin
    1       7-21    *       *       *       ~/jarvis/jarvis.sh -x "vérifie mes emails" # needs gmail plugin
    @midnight                               wget -qO /dev/null "http://mywebsite.com/backup"

You can of course write any shell command you'd like.

However, using:

./jarvis.sh -x "Do this"

option is quite handy at it allows to trigger actions the same way you speak them.
This makes creation and maintenance of Events easier, because your commands/plugins may evolve and you won't have to replicate those updates in the Events.

Voir aussi: Plugins