====================================
| FreeBSD manual install - Tuptime |
====================================


Install dependencies, latest versions:

    # pkg install python3 git
    # pkg install py39-sqlite3  # (version number must match "python3 -V")

Clone repository and copy executable file:

    # git clone --depth=1 https://github.com/rfmoz/tuptime.git
    # install -m 755 tuptime/src/tuptime /usr/local/bin/tuptime

Add tuptime user:

    # pw adduser _tuptime -d /nonexistent -s /usr/sbin/nologin -c "Tuptime execution user"

Execute tuptime with a privileged user for create db path:

    # tuptime

Change owner of the db path and file:

    # chown -R _tuptime:_tuptime /var/lib/tuptime

Add the cron entry, create a '/usr/local/etc/cron.d/tuptime' file with this content:

    */5 * * * * _tuptime (/usr/sbin/service tuptime enabled) && /usr/local/bin/tuptime -q

Copy rc.d file:

    # install -m 555 tuptime/src/rc.d/freebsd/tuptime /usr/local/etc/rc.d/tuptime
    # sysrc tuptime_enable=YES
    # service tuptime start

It's all done.



====================================
| OpenBSD manual install - Tuptime |
====================================


Install dependencies, latest versions:

    # pkg_add git python

Clone repository and copy executable file:

    # git clone --depth=1 https://github.com/rfmoz/tuptime.git
    # install -m 755 tuptime/src/tuptime /usr/local/bin/tuptime

Add tuptime user:

    # useradd -s /sbin/nologin -d /var/empty -L daemon _tuptime

Execute tuptime with a privileged user for create db path:

    # tuptime

Change owner of the db path and file:

    # chown -R _tuptime:_tuptime /var/lib/tuptime

Add the cron entry, create a '/var/cron/tabs/_tuptime' file with this content:

    SHELL=/bin/sh
    PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin/
    */5       *       *       *       *       tuptime -q

Set the right permissions to cron file and restart the service:

    # chown _tuptime:crontab /var/cron/tabs/_tuptime 
    # chmod 600 /var/cron/tabs/_tuptime 

Copy rc.d file:

    # install -m 555 tuptime/src/rc.d/openbsd/tuptime /etc/rc.d/tuptime
    # rcctl enable tuptime
    # rcctl start tuptime

It's all done.



===================================
| NetBSD manual install - Tuptime |
===================================


Install dependencies:

    # pkg_add git python3? py3?-sqlite3

Create a symlink for the Python3 interpreter:

    # mkdir -p /usr/local/bin/
    # ln -s /usr/pkg/bin/python3.? /usr/local/bin/python3
     
Install tls certs before clone the repo:

    # pkg_add mozilla-rootcerts
    # mozilla-rootcerts install

Clone repository and copy executable file:

    # git clone --depth=1 https://github.com/rfmoz/tuptime.git
    # install -m 755 tuptime/src/tuptime /usr/local/bin/tuptime

Execute tuptime with a privileged user for create db path:

    # tuptime

Add tuptime user:

    # useradd -d /var/lib/tuptime -s /sbin/nologin _tuptime

Change owner of the db path and file:

    # chown -R _tuptime:_tuptime /var/lib/tuptime

Add the cron entry, create a '/var/cron/tabs/_tuptime' file with this content:

    SHELL=/bin/sh
    PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin/
    */5       *       *       *       *       tuptime -q

Set the right permissions to cron file and restart the service:

    # chown _tuptime /var/cron/tabs/_tuptime 
    # chmod 600 /var/cron/tabs/_tuptime
    # service cron restart

Copy rc.d file:

    # install -m 555 tuptime/src/rc.d/freebsd/tuptime /etc/rc.d/tuptime
    # echo 'tuptime_enable="YES"' >> /etc/rc.conf

It's all done.
