DB_SQLITE_VACUUM_ON_STARTUP but not only on startup?

dear all

I successfully use DB_SQLITE_VACUUM_ON_STARTUP=true to avoid my disk space to get completely eaten up.
My question is : how can I automatically do this clean up periodically? (I mean, without stoping + rm-ing + up-ing docker)

thanks for your help

Hey @cie172,

The problem with the vacuum command from what I can understand is that it locks the database while running so if you have any tasks scheduled to run they will likely fail which may not be ideal.

You could script something outside of n8n to run the vacuum process but as it may lead to downtime anyway it might be easier to just restart the container from a script on a monthly schedule, I don’t think you need to delete the image for it to kick in though so just a restart should be enough.

If it helps what I ended up doing my n8n instance that I was running on a Pi was swap to Postgres which took a bit more space for the image itself to run but it meant I didn’t have to worry about the database as much.

1 Like

Thank you!
Once I noticed I had to do the rm for the disk space to actually get lower. But I may be wrong.
Do you have a pointer to how I could switch to Postgres? (I’m also on a pi)
Thanks again!!