risacher / sunwait

Sunwait calculates sunrise or sunset times with civil, nautical, astronomical and custom twilights, for use with Windows Task Scheduler or 'cron' on Linux.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sunwait usage question

universe241981 opened this issue · comments

Hi,
I browsed around through the internet about how to use sunwait with cron.
I followed one of the source and make the sunwait as well as cp the made sunwait into usr/local/bin

  1. The sunwait -p seem no longer work?
  2. The sunwait report [latitude] [longitude] is woking.

In case of I want to edit the crontab as below for everyday at 5AM, wait until astronomical twilight begin, then stop my overnight running system via http, the crontab should be as below?

00 05 * * * /usr/local/bin/sunwait wait astronomical rise [latitude] [longitude] ; curl -X POST http://<ip>/api/stop

Please advise.
Thank you very much.

I understand that sunwait -p used to be the way with older versions worked but now it's called the 'poll' option.

Example cron task that I use to restart a camera motion daemon at sunrise/sunset on a Raspberry Pi 4:

@reboot /home/pi/scripts/pi_sunwait wait rise 51.360258N -0.147890E; sudo service motion restart
@reboot /home/pi/scripts/pi_sunwait wait set 51.360258N -0.147890E; sudo service motion restart