chg: [README] updated README with the new clean script

pull/85/head
mokaddem 2018-10-31 15:45:19 +01:00
parent 00043d6763
commit 9905a82a79
2 changed files with 14 additions and 4 deletions

View File

@ -123,6 +123,16 @@ Happy hacking ;)
## Restart from scratch
To restart from scratch and empty all data from your dashboard you can use the [FLUSHDB](https://redis.io/commands/flushdb) or [FLUSHALL](https://redis.io/commands/flushall) command on your redis instance on port `6250`.
Or use the dedicated cleaning script ``clean.py``
```usage: clean.py [-h] [-b]
Clean data stored in the redis server specified in the configuration file
optional arguments:
-h, --help show this help message and exit
-b, --brutal Perfom a FLUSHALL on the redis database. If not set, will use
a soft method to delete only keys used by MISP-Dashboard.
```
# zmq_subscriber options

View File

@ -25,11 +25,11 @@ def clean(brutal=False):
if brutal:
print(RED+'Brutal mode'+DEFAULT+' selected')
print('Cleaning data...')
print('[%s:%s] Cleaning data...' % (host, port))
cleanBrutal(servers[0])
else:
print(GREEN+'Soft mode'+DEFAULT+' selected')
print('Cleaning data...')
print('[%s:%s] Cleaning data...' % (host, port))
cleanSoft(servers)
@ -77,8 +77,8 @@ def cleanSoft(servers):
serv.delete(*tuple(key_to_del))
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("-b", "--brutal", help="Brutal mode: basic FLUSHALL", default=False, action="store_true")
parser = argparse.ArgumentParser(description='Clean data stored in the redis server specified in the configuration file')
parser.add_argument("-b", "--brutal", default=False, action="store_true", help="Perfom a FLUSHALL on the redis database. If not set, will use a soft method to delete only keys used by MISP-Dashboard.")
args = parser.parse_args()
clean(args.brutal)
print(GREEN+'Done.'+DEFAULT)