SACDaq Data Logging Suite
Introduction
Setup for Automated Logging
# useradd -m -s /bin/bash sacdaq
# gpasswd -a sacdaq i2c
# gpasswd -a sacdaq spi
# gpasswd -a sacdaq gpio
# mkdir /opt/sacdaq
# chown sacdaq:sacdaq /opt/sacdaq
# sudo -u sacdaq -s
$ cd /opt/sacdaq
$ git clone https://github.com/kc2zgu/sacdaq .
$ mkdir logs
- Install Perl dependencies
(Debian)
# apt-get install libdatetime-perl libyaml-perl libipc-run-perl libfile-slurp-perl libuuid-tiny-perl libdbix-class-perl libdbd-sqlite3-perl libsql-translator-perl libdatetime-format-sqlite-perl
# cpan Device::I2C
/etc/systemd/system/sacdaq.service:
[Unit]
Description=SACDaq Agent
[Service]
Type=simple
ExecStart=/opt/sacdaq/agent.pl
WorkingDirectory=/opt/sacdaq
User=sacdaq
Group=sacdaq
# only on systemd >=236
#StandardOutput="file:/opt/sacdaq/logs/agent.log"
#StandardError="file:/opt/sacdaq/logs/agent.err"
* Sync reports with cron
$ crontab -e
*/15 * * * * cd /opt/sacdaq && perl sendreports-v2.pl
--
StephenCavilia - 06 Nov 2018