remove orphan files maintenance script

This commit is contained in:
rimu 2024-03-01 22:11:06 +13:00
parent 8ee0a98f4d
commit 60a6ecddef
2 changed files with 36 additions and 1 deletions

View file

@ -221,6 +221,12 @@ also [see this](https://pganalyze.com/blog/5mins-postgres-tuning-huge-pages).
(PgBouncer)[https://www.pgbouncer.org] can be helpful in a high traffic situation. (PgBouncer)[https://www.pgbouncer.org] can be helpful in a high traffic situation.
---
Background services
---
Gunicorn and Celery need to run as background services: Gunicorn and Celery need to run as background services:
### Gunicorn ### Gunicorn
@ -319,7 +325,11 @@ Inspect log files at:
/your_piefed_installation/logs/pyfedi.log /your_piefed_installation/logs/pyfedi.log
### Nginx ---
Nginx
---
You need a reverse proxy that sends all traffic to port 5000. Something like: You need a reverse proxy that sends all traffic to port 5000. Something like:
@ -357,3 +367,23 @@ You need a reverse proxy that sends all traffic to port 5000. Something like:
The above is not a complete configuration - you will want to add more settings for SSL, etc. The above is not a complete configuration - you will want to add more settings for SSL, etc.
---
Cron tasks
---
To send email reminders about unread notifications, put this in a new file under /etc/cron.d
```
1 */6 * * * rimu cd /home/rimu/pyfedi && /home/rimu/pyfedi/email_notifs.sh
```
Change /home/rimu/pyfedi to the location of your installation and change 'rimu' to the user that piefed runs as.
Once a week or so it's good to run remove_orphan_files.sh to save disk space:
```
5 4 * * 1 rimu cd /home/rimu/pyfedi && /home/rimu/pyfedi/remove_orphan_files.sh
```

5
remove_orphan_files.sh Executable file
View file

@ -0,0 +1,5 @@
#!/bin/bash
source venv/bin/activate
export FLASK_APP=pyfedi.py
flask remove_orphan_files