1

So I am a working on a simple home lightning control using Raspberry Pi (and raspbian). I can turn or dim lights by writing commands to a zigbee dongle (through a serial interface) by running a command like:

sudo echo "#1*##*1231#*9#" > /dev/ttyUSB0

One of its main functions is to program "scenes" so you can turn lights on and off at certain hour or day.

So how can I automate a bash command to run lets say monday, tuesday and saturday at 8:55AM every week? Thanks!

Multitut
  • 2,089
  • 7
  • 39
  • 63

1 Answers1

3

Use crontab. Those threads will help you:

So:

crontab -e  # edit crontab file

and then insert

55 8 * * 1,2,6 /usr/local/bin/my_cool_script

In case crontab is not flexible enough for your needs, you can use Ruby Rufus scheduler

Community
  • 1
  • 1
Jakub M.
  • 32,471
  • 48
  • 110
  • 179