From 4c9eb2c13150db1039e1c6fbfc91aaaabf4d845e Mon Sep 17 00:00:00 2001 From: Perflyst Date: Thu, 24 Jan 2019 19:11:14 +0100 Subject: [PATCH] Updated About the database and tables (markdown) --- About-the-database-and-tables.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/About-the-database-and-tables.md b/About-the-database-and-tables.md index 9f30fb7..07a537c 100644 --- a/About-the-database-and-tables.md +++ b/About-the-database-and-tables.md @@ -9,6 +9,13 @@ Invidious needs one PostgreSQL database with five tables. The table `videos` grows a lot and needs the most storage. You can clean it up using following commands: ```bash $ sudo -i -u postgres +$ psql invidious -c "DELETE FROM nonces * WHERE expire < current_timestamp" $ psql invidious -c "TRUNCATE TABLE videos" $ exit +``` + +For regular maintenance you should add a cronjob for these commands +```bash +@weekly psql invidious -c "DELETE FROM nonces * WHERE expire < current_timestamp" +@weekly psql invidious -c "TRUNCATE TABLE videos" ``` \ No newline at end of file