Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

https://forums.zoneminder.com/viewtopic.php?t=13928

https://crontab.guru/monday-to-friday

To save a run state you should first configure your monitors for Modect, Record, Monitor etc as you would want them during one of the times of day. Then click on the running state link at the top of the Console view. This will usually say 'Running' or 'Stopped'. You will then be able to save the current state and give it a name, 'Daytime' for example. Now configure your monitors how you would want them during other times of day and save that, for instance as 'Nighttime'.

Now you can switch between these two states by selecting them from the same dialog you saved them, or from the command line from issue the command zmpkg.pl <run state>, for example zmpkg.pl Daytime.

Now setup schedule via CRON like so:

Note: I found this caused issues, so my dirty hack was a reboot after switching modes. Pretty hackish..., but it works.

(test manually first!)

cat << 'EOL'>/etc/cron.d/zoneminder_schedule.cron
#zmpkgpl=/usr/local/bin/zmpkg.pl
zmpkgpl=/usr/bin/zmpkg.pl


0 23 * * 0-4 "$zmpkgpl" MoDect && reboot
0 8 * * 1-5 "$zmpkgpl" Monitor && reboot
EOL
  • No labels