Skip to content
reimannsum edited this page Jan 27, 2019 · 4 revisions

Welcome to the DangerBot wiki!

These are smaller files I need to write and add into the repo

Crontab

*/15 * * * * python3 getIP.py >/dev/null 2>&1
0 17 1,16,31 * * pipenv run python3 -m dangerbot clean >/dev/null 2>&1
0 18 1,6,11,16,21,26 * * pipenv run python3 -m dangerbot cleanMPM >/dev/null 2>&1
30 7,19 * * * pipenv run python3 -m dangerbot scout >/dev/null 2>&1
0 20 * * * pipenv run python3 -m dangerbot report >/dev/null 2>&1
0 21 * * 3 archive.sh "/home/pi/">/dev/null 2>&1

# 5pm every 15 days scan dangerReport pages for out of date info and mark it as "unknown"
# 6pm every 5 days check the MPM pages
# 7:30am & 7:30pm walk accounts
# 8pm log new walker data on wiki
# 9pm every Wednsday archive weekly logs

getIP.py

from requests import get
ip = get('https://api.ipify.org').text.
file = open('myIP','r')
lastIP = file.readline().strip()
file.close()
if lastIP is not ip:
	# do email new IP  https://realpython.com/python-send-email/
	file.open('myIP','w')
	file.write(ip)
	file.close()

archive.sh

$bin/bash
???SCRIPTDIR=$(dirname "$0")???
zip logs/archive/weekly-$(date +"%m-%d-%y").zip logs/* -x logs/archive/
rm logs/*.txt
Clone this wiki locally