Commands¶
Describes some commands to control PostgreSQL for different operating systems.
Global¶
Deletion of the database “odoo”:
psql
psql -U postgres -c "drop database odoo"
psql -l
\q
Location of the productive PostgreSQL database:
which psql
Result:
/usr/local/bin/psql
Location of the PostgreSQL program files:
/usr/local/Cellar
Location of the data dictionary:
SHOW data_directory;
Result:
/usr/local/var/postgres
Google Engine¶
Delete Database
sudo su - odoo -s /bin/bash
psql -l
dropdb Logistics_DB
Create Database
createdb -p 5432 -O odoo -e Logistics_DB
Verification of Database
acuumdb --full --dbname Logistics_DB --analyze --verbose
Backup and Restore¶
Basics of the Backup Scripts
1.a) Templates
Advanced Backup Script: script is based on Automate Odoo backups with this script.
Advanced Restore Script: script is based on Restore Odoo database with this script.
Google Cloud Engine
2.a) The apple script Script Odoo Backup Google executes a backup based on the Advanced Backup Script.
2.b) The apple script Script Odoo Restore Google executes a restore based on the Advanced Restore Script.
macOS
3.a) The apple script Script Odoo Backup Automate executes a backup based on the Advanced Backup Script.
3.b) The apple script Script Odoo Restore Automate executes a restore based on the Advanced Restore Script.
Raspberry Pi
Path to the scripts:
/home/pi/Documents/Script
Path to the backup directory (has to be entered in both scripts):
/home/pi/Documents/Backup
User with which the script has to be executed:
odoo
4.a) Backup
sudo su - odoo -s /bin/bash
cd /home/pi/Documents/Script
bash ./backup-dump.sh
exit
4.b) Restore
sudo su - odoo -s /bin/bash
cd /home/pi/Documents/Script
bash ./restore-dump.sh
exit