-
Notifications
You must be signed in to change notification settings - Fork 0
/
cron
executable file
·34 lines (30 loc) · 1.25 KB
/
cron
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
# This is the cron job that does the scheduled maintenace for Misago.
# It deletes old sessions, refreshes active posters list, prunes categories
# set to delete old threads, keeps read tracking record small, disables
# expired bans, etc. ect.
#
# Tasks defined in this file are ran sequentially, one after the other, making it
# simpler to keep things in order (eg. active posters list is populated after
# users and categories are pruned) and their memory usage is kept in check (no more
# than single maintenance task will be running at single time).
#
# You are free to edit this file to add custom `manage.py` calls for your site.
# Make sure database is available
./.run wait_for_db
# Remove logs older than 60 days
find /misago/logs/ -mindepth 1 -type f -mtime +60 -delete
# Run maintenance commands
python manage.py deletemarkedusers
python manage.py prunecategories
python manage.py buildactivepostersranking
python manage.py clearattachments
python manage.py clearnotifications
python manage.py clearreadtracker
python manage.py clearsessions
python manage.py clearsocial
python manage.py invalidatebans
python manage.py removeoldips
python manage.py deleteinactiveusers
python manage.py expireuserdatadownloads
python manage.py prepareuserdatadownloads