From: John Runyon Date: Wed, 1 Nov 2023 20:50:52 +0000 (-0600) Subject: fix find to trim oldlogs X-Git-Url: https://jfr.im/git/erebus.git/commitdiff_plain/92da6dea5d37a76b9ecfe5dec365c14c0574ddb0 fix find to trim oldlogs --- diff --git a/.gitignore b/.gitignore index edb2ec0..620d76e 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ bot.config nohup.out pidfile logfile +oldlogs/ diff --git a/README.md b/README.md index 521314d..497662d 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Install croncheck.sh in your crontab, if desired. `* * * * * /path/to/erebus/croncheck.sh` To suppress croncheck.sh from restarting the bot without removing from crontab, `touch dontstart` -Output will be placed in `logfile`, which is rotated to `oldlogs/`. (I strongly recommend `rm oldlogs/*` as a weekly crontab entry. `@weekly find /path/to/erebus/oldlogs/ -mtime 7 -execdir rm '{}' +`) +Output will be placed in `logfile`, which is rotated to `oldlogs/`. (I strongly recommend `rm oldlogs/*` as a weekly crontab entry. `@weekly find /path/to/erebus/oldlogs/ -mtime +7 '!' -name .keep -delete`) The bot targets Python 3 only. It has some time ago switched to being primarily tested on Python 3. Python 2 support is presumed to have slowly eroded due to a lack of testing. It probably won't work. diff --git a/oldlogs/.gitignore b/oldlogs/.gitignore deleted file mode 100644 index d6b7ef3..0000000 --- a/oldlogs/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/oldlogs/.keep b/oldlogs/.keep new file mode 100644 index 0000000..e69de29