Cron

From ZoneMinder Wiki
Revision as of 00:18, 1 March 2018 by Snake (talk | contribs) (→‎Tips)
Jump to navigationJump to search

Here is an example crontab you might use with Zoneminder. These are put in /etc/crontab which is easier than managing individual user crontabs. Used in Devuan Jessie, ZM 1.30.

Example Crontab

#disable cron emails
MAILTO=""

#backup
00 5 * * 6 root mysqladmin -u zmuser --password=zmpass zm > /somewhere/zmdbbackup.sql

#reboot once a month
00 1 1 * * root /sbin/reboot

#monitor HDD health
00 1 * * 1 root /usr/sbin/smartctl -t short /dev/sda

30 1 * * 1 root /usr/sbin/smartctl -l selftest /dev/sda > /somewhere/HDD_HealthReport.txt

35 1 * * 1 root echo "hdd report" | mail  -A /somewhere/HDD_HealthReport.txt -s "HD SMART TEST FOR ZM SERVER" email@address.com

#set different runstate for weekends
00 1 * * 6  www-data  /usr/bin/zmpkg.pl Weekend
00 23 * * 7  www-data  /usr/bin/zmpkg.pl Weekday

Tips