]> jfr.im git - erebus.git/commitdiff
fix log rotation
authorzonidjan <redacted>
Tue, 13 Sep 2016 13:31:37 +0000 (08:31 -0500)
committerzonidjan <redacted>
Tue, 13 Sep 2016 13:31:37 +0000 (08:31 -0500)
.gitignore
erebus.py
oldlogs/.gitignore [new file with mode: 0644]

index a8a352054f06ac9f135f5e43d7420781a5d9cbbd..edb2ec0bb06bf28a91ebc1715e379536ed760b5f 100644 (file)
@@ -7,5 +7,4 @@ bot.config
 *.json
 nohup.out
 pidfile
-oldlog.*
 logfile
index a4d6ca300c01fae1694830e053f1513da720076f..e6c0459af897a6af79ec6cb085a1c01a8ecd22d0 100644 (file)
--- a/erebus.py
+++ b/erebus.py
@@ -284,7 +284,7 @@ def loop():
                        main.fd(fileno).parse(line)
 
 if __name__ == '__main__':
-       try: os.rename('logfile', 'oldlog.%s' % (time.time()))
+       try: os.rename('logfile', 'oldlogs/%s' % (time.time()))
        except: pass
        sys.stdout = open('logfile', 'w')
        sys.stderr = sys.stdout
diff --git a/oldlogs/.gitignore b/oldlogs/.gitignore
new file mode 100644 (file)
index 0000000..d6b7ef3
--- /dev/null
@@ -0,0 +1,2 @@
+*
+!.gitignore