Tool to create full backup of odoo database
Project description
odoo-backup-db-cli
Tool to create full backup of odoo database
Features
- Fully typed with annotations and checked with mypy, PEP561 compatible
- Add yours!
Installation
pip install odoo-backup-db-cli
Example creating cron
Let's say you want to create cron each minute create backup and you have a conda environment. Then you need:
-
Copy snippet appended by Anaconda in
~/.bashrc(at the end of the file) to a separate file~/.bashrc_condaAs of Anaconda 2020.02 installation, the snippet reads as follows:
# >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! __conda_setup="$('/home/USERNAME/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" if [ $? -eq 0 ]; then eval "$__conda_setup" else if [ -f "/home/USERNAME/anaconda3/etc/profile.d/conda.sh" ]; then . "/home/USERNAME/anaconda3/etc/profile.d/conda.sh" else export PATH="/home/USERNAME/anaconda3/bin:$PATH" fi fi unset __conda_setup # <<< conda initialize <<<
Make sure that:
- The path
/home/USERNAME/anaconda3/is correct. - The user running the cronjob has read permissions for
~/.bashrc_conda(and no other user can write to this file).
- The path
-
In
crontab -eadd lines to run cronjobs onbashand to source~/.bashrc_condaRun
crontab -eand insert the following before the cronjob:SHELL=/bin/bash BASH_ENV=~/.bashrc_conda
-
In
crontab -einclude at beginning of the cronjobconda activate my_env;as in exampleExample of entry for a script that would execute at noon 12:30 each day on the Python interpreter within the conda environment:
30 12 * * * conda activate my_env; odoo-backup-db-cli create-backup production_local_with_filestore; conda deactivate
And that's it.
You may want to check from time to time that the snippet in ~/.bashrc_conda is up to date in case conda updates its snippet in ~/.bashrc.
License
Credits
This project was generated with wemake-python-package. Current template version is: 88c80f5d17a6f4bc41dbc5473db4f5ffd2b3068f. See what is updated since then.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file odoo-backup-db-cli-1.0.0.tar.gz.
File metadata
- Download URL: odoo-backup-db-cli-1.0.0.tar.gz
- Upload date:
- Size: 21.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.7.9 Linux/5.8.0-40-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab76dcde3b3fba56a5d8a6cd459cce8cdc9a9c5c2f61245ec25c15e8392c3d97
|
|
| MD5 |
ea05789b74ed7f1f44b49915561c72e4
|
|
| BLAKE2b-256 |
87f7f31dff19ca210d2277f8045f57084933ee49aa748f59d7865392c3e54c45
|
File details
Details for the file odoo_backup_db_cli-1.0.0-py3-none-any.whl.
File metadata
- Download URL: odoo_backup_db_cli-1.0.0-py3-none-any.whl
- Upload date:
- Size: 23.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.7.9 Linux/5.8.0-40-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a64fd68dabf88dc098c3fbc9aa7069d8d7474051a03b74f07ef660c03b722b67
|
|
| MD5 |
d8c93759147a837a8dbf8dbc2b7bc1e9
|
|
| BLAKE2b-256 |
6215df5853e6e6d13a173404bbcc5154e6ee31a0468d75882b47397ea913e03f
|