Code Monkey home page Code Monkey logo

odoo-backup-db-cli's Introduction

odoo-backup-db-cli

Build Status Python Version Documentation Status wemake-python-styleguide

Tool to create full backup of odoo database

Features

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:

  1. Copy snippet appended by Anaconda in ~/.bashrc (at the end of the file) to a separate file ~/.bashrc_conda

    As 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).
  2. In crontab -e add lines to run cronjobs on bash and to source ~/.bashrc_conda

    Run crontab -e and insert the following before the cronjob:

    SHELL=/bin/bash
    BASH_ENV=~/.bashrc_conda
  3. In crontab -e include at beginning of the cronjob conda activate my_env; as in example

    Example 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

agpl3

Credits

This project was generated with wemake-python-package. Current template version is: 88c80f5d17a6f4bc41dbc5473db4f5ffd2b3068f. See what is updated since then.

odoo-backup-db-cli's People

Contributors

okolovmark avatar ventor-dev avatar github-actions[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.