<commit_before>install:
	sh install.sh
	sh import.keepright.sh
	sh import.osmi.sh

reimport:
	make dropdbs
	sh import.keepright.sh
	sh.import.osmi.sh

keepright.sql:
	FILE="keepright-$(date +%s).sql"
	sudo -u postgres pg_dump keepright > $FILE
	echo "new backup: $FILE"

osmi.sql:
	FILE="osmi-$(date +%s).sql"
	sudo -u postgres pg_dump osmi > $FILE
	echo "new backup: $FILE"

backup:
	make keepright.sql
	make osmi.sql

dropdbs:
	echo 'dropping databases'
	echo "DROP DATABASE osmi;" | psql -U postgres
	echo "DROP DATABASE keepright;" | psql -U postgres

tasks:
	rm -rf keepright-tasks
	rm -rf osmi-tasks
	sh tasks.keepright.sh
	sh tasks.osmi.sh
	# need to figure out hashing

server:
	sudo ./node_modules/forever/bin/forever start index.js<commit_msg>Updateable datasources<commit_after>install:
	sh install.sh
	sh import.keepright.sh
	sh import.osmi.sh

reimport:
	make dropdbs
	sh import.keepright.sh
	sh.import.osmi.sh

update-keepright:
	echo 'updating keepright'
	echo "DROP DATABASE keepright;" | psql -U postgres
	sh import.keepright.sh
	echo 'done updating keepright'

update-osmi:
	echo 'updating osmi'
	echo "DROP DATABASE osmi;" | psql -U postgres
	sh import.osmi.sh
	echo 'done updating osmi'

keepright.sql:
	FILE="keepright-$(date +%s).sql"
	sudo -u postgres pg_dump keepright > $FILE
	echo "new backup: $FILE"

osmi.sql:
	FILE="osmi-$(date +%s).sql"
	sudo -u postgres pg_dump osmi > $FILE
	echo "new backup: $FILE"

backup:
	make keepright.sql
	make osmi.sql

dropdbs:
	echo 'dropping databases'
	echo "DROP DATABASE osmi;" | psql -U postgres
	echo "DROP DATABASE keepright;" | psql -U postgres

keepright-tasks:
	rm -rf keepright-tasks
	sh tasks.keepright.sh

osmi-tasks:
	rm -rf osmi-tasks
	sh tasks.osmi.sh

server:
	sudo ./node_modules/forever/bin/forever start index.js
{'fraction_non_alphanumeric': 0.11166945840312674, 'fraction_numerical': 0.0, 'mean_word_length': 3.9916434540389973, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4237929', 'n_tokens_mistral': 737, 'n_tokens_neox': 710, 'n_words': 196}