#!/bin/bash # # Update all data in the databases. # cd /home/annika/public_html user_count=$(who | awk '{print $1}' | wc -l) user_unique=$(who | awk '{print $1}' | sort | uniq | wc -l) user_mesg_y=$(who -Ts | awk '{print $1 $2}' | sort | uniq | grep '+$' | wc -l) user_accounts=$(ls /home | wc -l) pages_updated=$(jq '.pagelist[].username' < /home/delfuego/public_html/tilde.24h.json | wc -l) echo "$EPOCHSECONDS:$user_count:$user_unique:$user_mesg_y:$user_accounts" | tee -a users.txt rrdtool updatev users.rrd -t user_count:user_unique:user_mesg_y:user_accounts \ "$EPOCHSECONDS:$user_count:$user_unique:$user_mesg_y:$user_accounts" echo "$EPOCHSECONDS:$pages_updated" | tee -a pages.txt rrdtool updatev pages.rrd "$EPOCHSECONDS:$pages_updated"