From: zonidjan Date: Tue, 13 Sep 2016 13:26:48 +0000 (-0500) Subject: log rotation X-Git-Url: https://jfr.im/git/erebus.git/commitdiff_plain/0bf186e88f4f1753b7bc8096eb99fb9ac58fd858?hp=24b74bb30ce43c47dae6a7b93452012b07c505d6 log rotation --- diff --git a/.gitignore b/.gitignore index 2c51b46..a8a3520 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ bot.config *.json nohup.out pidfile +oldlog.* +logfile diff --git a/erebus.py b/erebus.py index e6c0459..a4d6ca3 100644 --- a/erebus.py +++ b/erebus.py @@ -284,7 +284,7 @@ def loop(): main.fd(fileno).parse(line) if __name__ == '__main__': - try: os.rename('logfile', 'oldlogs/%s' % (time.time())) + try: os.rename('logfile', 'oldlog.%s' % (time.time())) except: pass sys.stdout = open('logfile', 'w') sys.stderr = sys.stdout