Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
10565 Lượt xem

i want to take backup of odoo database using shell script please guide for the same. i am new here. please elaborate step by step.

Ảnh đại diện
Huỷ bỏ
#!/bin/bash

# vars
BACKUP_DIR=~/odoo_backups
ODOO_DATABASE=db1
ADMIN_PASSWORD=superadmin_passwd

# create a backup directory
mkdir -p ${BACKUP_DIR}

# create a backup
curl -X POST \
    -F "master_pwd=${ADMIN_PASSWORD}" \
    -F "name=${ODOO_DATABASE}" \
    -F "backup_format=zip" \
    -o ${BACKUP_DIR}/${ODOO_DATABASE}.$(date +%F).zip \
    http://localhost:8069/web/database/backup


# delete old backups
find ${BACKUP_DIR} -type f -mtime +7 -name "${ODOO_DATABASE}.*.zip" -delete

On Mon, Jul 29, 2019 at 4:37 PM Ajeet Yadav <ajeet1990yadav@gmail.com> wrote:

A new answer on backup of odoo using shell has been posted. Click here to access the post :

See post

Sent by Odoo S.A. using Odoo.

I use attached code with crontab -e but not a directory creation and backup executed.

On Mon, Jul 29, 2019 at 4:37 PM Ajeet Yadav <ajeet1990yadav@gmail.com> wrote:

A new answer on backup of odoo using shell has been posted. Click here to access the post :

See post

Sent by Odoo S.A. using Odoo.

Câu trả lời hay nhất

Hi You can run below command in sh file to create backup-

pg_dump --no-owner dabase_name | gzip > /path for store backp file/backup_file.gz

above command you can put in .sh file and follow below link to create cron job in ubuntu-

https://www.youtube.com/watch?v=CIVI-DIzCFk

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Beware that this does not work if lit_db = False as this is a procedure trying to go through Odoo's interface.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Is there any option to automate backup to ftp location in odoo.sh v16 , is there any module available as well to do so. I tried yenthe backup module but its not working in odoo.sh v 16

Ảnh đại diện
Huỷ bỏ