backup script and minor config changes
This commit is contained in:
parent
34b7a1c280
commit
75e0100144
4 changed files with 41 additions and 3 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -5,6 +5,8 @@ node_modules
|
||||||
.project
|
.project
|
||||||
config.local.yml
|
config.local.yml
|
||||||
hit_store.db
|
hit_store.db
|
||||||
|
backup/*
|
||||||
www/scans/*.svg
|
www/scans/*.svg
|
||||||
#scanimation/interfa
|
#scanimation/interfa
|
||||||
|
GeoLite2-Country.mmdb
|
||||||
|
|
||||||
|
|
36
backup_and_reset.sh
Executable file
36
backup_and_reset.sh
Executable file
|
@ -0,0 +1,36 @@
|
||||||
|
#!/bin/bash
|
||||||
|
BACKUP_DIR="backup/$1"
|
||||||
|
|
||||||
|
if [ -d "$BACKUP_DIR" ]; then
|
||||||
|
>&2 echo "$BACKUP_DIR already exists. (usage: ./backup_and_reset.sh BACKUP_NAME)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
read -p "If you continue current config will be copied to '$BACKUP_DIR'. Continue? [y/n]" -r
|
||||||
|
echo # (optional) move to a new line
|
||||||
|
if [[ ! $REPLY =~ ^[Yy]$ ]]
|
||||||
|
then
|
||||||
|
echo "Cancelling"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir "$BACKUP_DIR"
|
||||||
|
cp www/scans "$BACKUP_DIR/" -Rv
|
||||||
|
cp hit_store.db "$BACKUP_DIR/"
|
||||||
|
cp scanimation/interfaces/frames "$BACKUP_DIR/" -Rv
|
||||||
|
|
||||||
|
|
||||||
|
read -p "Reset or keep original files. WARNING, type yes for reset [y/n]" -r
|
||||||
|
echo # (optional) move to a new line
|
||||||
|
if [[ ! $REPLY =~ ^[Yy]$ ]]
|
||||||
|
then
|
||||||
|
echo "Exit without resetting."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# reset
|
||||||
|
rm hit_store.db
|
||||||
|
rm scanimation/interfaces/frames/*.jpg
|
||||||
|
rm www/scans/*.svg
|
||||||
|
|
||||||
|
echo "Done resetting files."
|
|
@ -44,7 +44,7 @@ if __name__ == '__main__':
|
||||||
coloredlogs.install(
|
coloredlogs.install(
|
||||||
level=loglevel,
|
level=loglevel,
|
||||||
# default: "%(asctime)s %(hostname)s %(name)s[%(process)d] %(levelname)s %(message)s"
|
# default: "%(asctime)s %(hostname)s %(name)s[%(process)d] %(levelname)s %(message)s"
|
||||||
fmt="%(asctime)s %(hostname)s %(name)s[%(process)d,%(threadName)s] %(levelname)s %(message)s"
|
fmt="%(asctime)s %(hostname)s %(name)s[%(process)d,%(threadName)s,%(pathname)s:%(lineno)d] %(levelname)s %(message)s"
|
||||||
)
|
)
|
||||||
|
|
||||||
# File logging
|
# File logging
|
||||||
|
|
|
@ -235,7 +235,7 @@ class ConfigWebSocketHandler(tornado.websocket.WebSocketHandler):
|
||||||
"""
|
"""
|
||||||
Websocket for config & control
|
Websocket for config & control
|
||||||
"""
|
"""
|
||||||
CORS_ORIGINS = ['localhost', 'guest.rubenvandeven.com']
|
CORS_ORIGINS = ['localhost', '192.168.1.102','guest.rubenvandeven.com']
|
||||||
connections = set()
|
connections = set()
|
||||||
|
|
||||||
def initialize(self, config, plotterQ: Queue, eventQ: Queue, store: HITStore):
|
def initialize(self, config, plotterQ: Queue, eventQ: Queue, store: HITStore):
|
||||||
|
|
Loading…
Reference in a new issue