All by backup system is great here. But it miss one thing... How could I erase my oldest databases with my script? Which system do you use?
For the moment, I can delete database easily with (example) :
/usr/bin/dropdb -U "odoo" odoo_quotidien_01-12-2014_17:00:01 2>>/home/flooder/Programmes/log/clean-databases-pt.log
All my databases names are in the form (with the date in):
Thanks for youtr tips!
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
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 2/3/15, 7:56 AM|
|Seen: 715 times|
|Last updated: 3/19/15, 10:45 AM|