Odoo Help

2 Answers

Yenthe Van Ginneken

--Yenthe Van Ginneken--
| 8 8 10
--Yenthe Van Ginneken--

My Odoo blog: http://www.odoo.yenthevg.com/

My Twitter: https://twitter.com/Yenthe666

Yenthe Van Ginneken
2/3/15, 7:59 AM

You should script a bash script for this. I assume you always place the dumps in the same folder. Create a bash script that automaticly checks all files in the directory and let it remove the oldest (or for example dumps older than xx days)

A great example: https://wiki.postgresql.org/wiki/Automated_Backup_on_Linux 
Also have a look at this script: https://www.odoo.com/nl_NL/forum/help-1/question/how-do-i-automate-database-backups-8899
You can customize this as you wish. On a specific date, looping over them, creating a new one every xx time etc.

Update: If you also want to drop the db's / schema's from your postgreSQL you should look at the dropdb and drop schema commands. For example: http://www.postgresql.org/docs/9.4/static/sql-dropschema.html

Update #2

I've created a module which automatically does all this and is integrated in Odoo (V8).Have a look at my guide/topic about it here.

Pascal Tremblay
2/3/15, 8:02 AM

For the dump files, i'm ok. I can clean the oldest files. Now I want to delete ALSO the DATABASES. When I export to dump file, I also create a new database with it automatically. Now I have 200 databases and I want to clean it. Thanks

Yenthe Van Ginneken
2/3/15, 8:05 AM

You should then look at the dropdb and drop schema command (http://www.postgresql.org/docs/9.4/static/sql-dropschema.html for example)

Stephen Mack
2/3/15, 8:28 AM

Nice solution



| 6 5 7
Lodz, Poland

2/3/15, 9:17 AM

My suggestion, if your system Debian or Ubuntu, install module autopostgresqlbackup:

sudo apt-get update
sudo apt-get install autopostgresqlbackup

This is the best tools for me. This create, auto and hot: latest, daily, weekly and monthly backup with rotation, triggered by cron.

Ask a Question
Keep Informed
1 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now