X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;ds=sidebyside;f=sima%2Flaunch.py;h=9cd36232abecaf1779d29e6b9236a4fa54be5293;hb=abb05a55c1b6c27a11bbd90efbc594ad6331bbc6;hp=a8e285efbf296205fd14d5ad7e899478d7a5eb6e;hpb=a3d395dcb801e2e9399ba2469e851b0e591f4cd3;p=mpd-sima.git diff --git a/sima/launch.py b/sima/launch.py index a8e285e..9cd3623 100644 --- a/sima/launch.py +++ b/sima/launch.py @@ -110,6 +110,14 @@ def start(sopt, restart=False): else: logger.info('Database already there, not overwriting %s', db_file) sys.exit(0) + if cmd == "purge-history": + db_file = config.get('sima', 'db_file') + if not isfile(db_file): + logger.warning('No db found: %s', db_file) + sys.exit(1) + SimaDB(db_path=db_file).purge_history(duration=0) + sys.exit(0) + # TODO: To remove eventually in next major realese v0.18 # Create Database