Update to 2021-08-30 11:00

master
Daniel Berteaud 3 years ago
parent be02df63c4
commit 0bebbc32df
  1. 4
      roles/akeneo_pim/templates/pre-backup.j2
  2. 2
      roles/ampache/templates/pre-backup.j2
  3. 4
      roles/appsmith/templates/pre-backup.sh.j2
  4. 10
      roles/bitwarden_rs/templates/pre-backup.sh.j2
  5. 8
      roles/bluemind/templates/pre-backup.j2
  6. 3
      roles/bookstack/templates/pre-backup.j2
  7. 4
      roles/crowdsec/templates/pre-backup.j2
  8. 1
      roles/documize/tasks/archive_pre.yml
  9. 9
      roles/documize/templates/pre-backup.j2
  10. 4
      roles/dolibarr/templates/pre-backup.j2
  11. 4
      roles/elasticsearch/templates/pre-backup.j2
  12. 2
      roles/etherpad/templates/post_backup.sh.j2
  13. 6
      roles/etherpad/templates/pre_backup.sh.j2
  14. 8
      roles/freepbx/templates/pre_backup.sh.j2
  15. 1
      roles/funkwhale/tasks/archive_pre.yml
  16. 7
      roles/funkwhale/templates/pre-backup.sh.j2
  17. 4
      roles/gitea/templates/pre_backup.sh.j2
  18. 4
      roles/glpi/templates/pre_backup.j2
  19. 4
      roles/graylog/templates/pre-backup.j2
  20. 4
      roles/itop/templates/pre-backup.sh.j2
  21. 1
      roles/mailman/tasks/archive_pre.yml
  22. 7
      roles/mailman/templates/pre-backup.sh.j2
  23. 2
      roles/matomo/templates/pre-backup.j2
  24. 1
      roles/matrix_synapse/tasks/archive_pre.yml
  25. 4
      roles/matrix_synapse/templates/pre-backup.sh.j2
  26. 1
      roles/mayan_edms/tasks/archive_pre.yml
  27. 7
      roles/mayan_edms/templates/pre_backup.sh.j2
  28. 4
      roles/metabase/templates/pre-backup.j2
  29. 1
      roles/miniflux/tasks/archive_pre.yml
  30. 5
      roles/miniflux/templates/pre-backup.j2
  31. 4
      roles/mongodb_server/templates/pre-backup.j2
  32. 2
      roles/mysql_server/templates/pre-backup.j2
  33. 4
      roles/n8n/templates/pre-backup.sh.j2
  34. 4
      roles/navidrome/templates/pre-backup.j2
  35. 4
      roles/odoo/templates/pre-backup.sh.j2
  36. 2
      roles/omv/templates/omv_pre_backup.sh.j2
  37. 4
      roles/openproject/templates/pre-backup.sh.j2
  38. 4
      roles/openxpki/templates/pre-backup.j2
  39. 4
      roles/paperless_ng/defaults/main.yml
  40. 1
      roles/paperless_ng/tasks/archive_pre.yml
  41. 14
      roles/paperless_ng/tasks/facts.yml
  42. 2
      roles/paperless_ng/tasks/install.yml
  43. 2
      roles/paperless_ng/tasks/user.yml
  44. 5
      roles/paperless_ng/templates/paperless.conf.j2
  45. 5
      roles/paperless_ng/templates/pre-backup.j2
  46. 1
      roles/paperless_ng/vars/RedHat-8.yml
  47. 1
      roles/papermerge/tasks/archive_pre.yml
  48. 4
      roles/pmg/templates/pmg_pre_backup.sh.j2
  49. 4
      roles/postgresql_server/templates/pre-backup.sh.j2
  50. 1
      roles/psono/tasks/archive_pre.yml
  51. 5
      roles/psono/templates/pre-backup.sh.j2
  52. 4
      roles/rabbitmq_server/templates/pre-backup.j2
  53. 2
      roles/redis_server/files/redis_copy_dumps.sh
  54. 14
      roles/samba/templates/samba_pre_backup.sh.j2
  55. 8
      roles/seafile/templates/pre-backup.sh.j2
  56. 4
      roles/unifi/templates/pre-backup.sh.j2
  57. 12
      roles/vaultwarden/templates/pre-backup.sh.j2
  58. 2
      roles/wapt_server/templates/pre-backup.sh.j2
  59. 14
      roles/wordpress/templates/pre-backup.sh.j2
  60. 4
      roles/zabbix_server/templates/pre_backup.sh.j2
  61. 4
      roles/zimbra/templates/pre_backup.sh.j2

@ -1,4 +1,6 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
/usr/bin/mysqldump \
{% if pim_db_server not in ['localhost','127.0.0.1'] %}

@ -1,5 +1,7 @@
#!/bin/sh
set -eo pipefail
/usr/bin/mysqldump --user={{ ampache_mysql_user | quote }} \
--password={{ ampache_mysql_pass | quote }} \
--host={{ ampache_mysql_server | quote }} \

@ -1,4 +1,6 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
mongodump \
{% if appsmith_mongo_pass is defined and appsmith_mongo_pass != False %}

@ -1,13 +1,15 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
mkdir -p /home/lbkp/bitwarden_rs/
cp {{ bitwarden_root_dir }}/data/rsa* {{ bitwarden_root_dir }}/backup/
{% if bitwarden_db_engine == 'mysql' %}
/usr/bin/mysqldump \
{% if bitwarden_db_server != 'localhost' and bitwarden_db_server != '127.0.0.1' %}
--user='{{ bitwarden_db_user }}' \
--password='{{ bitwarden_db_pass }}' \
--host='{{ bitwarden_db_server }}' \
--user={{ bitwarden_db_user }} \
--password={{ bitwarden_db_pass | quote }} \
--host={{ bitwarden_db_server }} \
{% endif %}
--quick --single-transaction \
--add-drop-table {{ bitwarden_db_name }} | zstd -T0 -c > {{ bitwarden_root_dir }}/backup/{{ bitwarden_db_name }}.sql.zst

@ -1,6 +1,6 @@
#!/bin/sh
set -e
set -eo pipefail
DEST=/home/lbkp/bm/pgsql
mkdir -p $DEST
@ -9,9 +9,9 @@ chmod 700 $DEST
for DB in $(su - postgres -c "/bin/psql -d postgres -qtc 'SELECT datname from pg_database' | grep -vP '^\s+?template[01]$'")
do
su - postgres -c "/bin/pg_dump -Fp -Cc $DB" | /bin/nice -n 10 lz4 -c > $DEST/$DB.sql.lz4
su - postgres -c "/bin/pg_dump -Fp -Cc $DB" | /bin/nice -n 10 zstd -c > $DEST/$DB.sql.zst
done
su - postgres -c "/bin/pg_dumpall --globals-only" | /bin/nice -n 10 lz4 -c > $DEST/pg_globals.sql.lz4
su - postgres -c "/bin/pg_dumpall --schema-only" | /bin/nice -n 10 lz4 -c > $DEST/pg_schema.sql.lz4
su - postgres -c "/bin/pg_dumpall --globals-only" | /bin/nice -n 10 zstd -c > $DEST/pg_globals.sql.zst
su - postgres -c "/bin/pg_dumpall --schema-only" | /bin/nice -n 10 zstd -c > $DEST/pg_schema.sql.zst
cp -a /etc/bm/local /home/lbkp/bm/conf

@ -1,4 +1,5 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
/usr/bin/mysqldump \
{% if bookstack_db_server not in ['localhost','127.0.0.1'] %}

@ -1,4 +1,6 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
{% if cs_lapi_enabled %}
{% if cs_db_engine == 'mysql' %}

@ -12,6 +12,7 @@
command: >
/usr/pgsql-13/bin/pg_dump
--clean
--create
--host={{ documize_db_server }}
--port={{ documize_db_port }}
--username={{ documize_db_user }}

@ -1,4 +1,6 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
{% if documize_db_engine == 'mysql' %}
/usr/bin/mysqldump \
@ -11,13 +13,14 @@
--add-drop-table {{ documize_db_name | quote }} | zstd -c > "{{ documize_root_dir }}/backup/{{ documize_db_name }}.sql.zst"
{% elif documize_db_engine == 'postgres' %}
{% if documize_db_server not in ['127.0.0.1','localhost'] %}
PGPASSWORD='{{ documize_db_pass }}' /usr/pgsql-13/bin/pg_dump \
PGPASSWORD={{ documize_db_pass | quote }} /usr/pgsql-13/bin/pg_dump \
--clean \
--create \
--username={{ documize_db_user | quote }} \
--host={{ documize_db_server | quote }} \
{{ documize_db_name | quote }} | \
{% else %}
su - postgres -c "/usr/pgsql-13/bin/pg_dump --clean {{ documize_db_name | quote }}" | \
su - postgres -c "/usr/pgsql-13/bin/pg_dump --clean --create {{ documize_db_name | quote }}" | \
{% endif %}
zstd -c > "{{ documize_root_dir }}/backup/{{ documize_db_name }}.sql.zst"
{% endif %}

@ -1,7 +1,9 @@
#!/bin/sh
set -eo pipefail
/usr/bin/mysqldump --user={{ dolibarr_db_user }} \
--password={{ dolibarr_db_pass | quote }} \
--host={{ dolibarr_db_server }} \
--quick --single-transaction \
--add-drop-table {{ dolibarr_db_name }} | lz4 -c > {{ dolibarr_root_dir }}/db_dumps/{{ dolibarr_db_name }}.sql.lz4
--add-drop-table {{ dolibarr_db_name }} | zstd -c > {{ dolibarr_root_dir }}/db_dumps/{{ dolibarr_db_name }}.sql.zst

@ -1,4 +1,6 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
mkdir -p /home/lbkp/es
mount -o bind,ro {{ es_backup_dir }} /home/lbkp/es

@ -1,3 +1,3 @@
#!/bin/sh
rm -f {{ etherpad_root_dir }}/db_dump/*
rm -f {{ etherpad_root_dir }}/db_dumps/*

@ -1,7 +1,9 @@
#!/bin/sh
set -eo pipefail
/usr/bin/mysqldump --user={{ etherpad_db_user }} \
--password='{{ etherpad_db_pass }}' \
--password={{ etherpad_db_pass | quote }} \
--host={{ etherpad_db_server }} \
--quick --single-transaction \
--add-drop-table {{ etherpad_db_name }} | lz4 -c > {{ etherpad_root_dir }}/db_dumps/{{ etherpad_db_name }}.sql.lz4
--add-drop-table {{ etherpad_db_name }} | zstd -c > {{ etherpad_root_dir }}/db_dumps/{{ etherpad_db_name }}.sql.zst

@ -1,10 +1,12 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
/usr/bin/mysqldump \
--quick --single-transaction \
{% if fpbx_db_server not in ['127.0.0.1', 'localhost'] %}
--user={{ fpbx_db_user }} \
--password='{{ fpbx_db_pass }}' \
--password={{ fpbx_db_pass | quote }} \
--host={{ fpbx_db_server }} \
{% endif %}
--add-drop-table {{ fpbx_db_name }} | zstd -T0 -c > {{ fpbx_root_dir }}/backup/{{ fpbx_db_name }}.sql.zst
@ -12,7 +14,7 @@
--quick --single-transaction \
{% if fpbx_db_server not in ['127.0.0.1', 'localhost'] %}
--user={{ fpbx_db_user }} \
--password='{{ fpbx_db_pass }}' \
--password={{ fpbx_db_pass | quote }} \
--host={{ fpbx_db_server }} \
{% endif %}
--add-drop-table {{ fpbx_cdr_db_name }} | zstd -T0 -c > {{ fpbx_root_dir }}/backup/{{ fpbx_cdr_db_name }}.sql.zst

@ -21,6 +21,7 @@
command: >
/usr/pgsql-13/bin/pg_dump
--clean
--create
--host={{ funkwhale_db_server }}
--port={{ funkwhale_db_port }}
--username=sqladmin {{ funkwhale_db_name }}

@ -1,7 +1,10 @@
#!/bin/bash -e
#!/bin/sh
PGPASSWORD='{{ funkwhale_db_pass }}' /usr/pgsql-13/bin/pg_dump \
set -eo pipefail
PGPASSWORD={{ funkwhale_db_pass | quote }} /usr/pgsql-13/bin/pg_dump \
--clean \
--create \
--username={{ funkwhale_db_user | quote }} \
--host={{ funkwhale_db_server | quote }} \
{{ funkwhale_db_name | quote }} | \

@ -1,4 +1,6 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
/usr/bin/mysqldump --user={{ gitea_db_user | quote }} \
--password={{ gitea_db_pass | quote }} \

@ -1,4 +1,6 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
/usr/bin/mysqldump --user={{ glpi_mysql_user | quote }} \
--password={{ glpi_mysql_pass | quote }} \

@ -1,4 +1,6 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
mongodump \
{% if graylog_mongo_url | length == 1 and graylog_mongo_pass is defined and graylog_mongo_pass != False %}

@ -1,4 +1,6 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
/usr/bin/mysqldump \
{% if itop_db_server not in ['127.0.0.1','localhost'] %}

@ -22,6 +22,7 @@
command: >
/usr/pgsql-13/bin/pg_dump
--clean
--create
--host={{ mailman_db_server | quote }}
--port={{ mailman_db_port | quote }}
--username=sqladmin {{ mailman_db_name | quote }}

@ -1,11 +1,14 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
{% for db in mailman_db_name.keys() | list %}
{% if mailman_db_engine == 'postgres' %}
{% if mailman_db_server not in ['localhost', '127.0.0.1'] %}
PGPASSWORD={{ mailman_db_pass | quote }} \
/usr/pgsql-13/bin/pg_dump \
--clear \
--clean \
--create \
--username={{ mailman_db_user | quote }} \
--host={{ mailman_db_server | quote }} \
--port={{ mailman_db_port }} \

@ -1,5 +1,7 @@
#!/bin/sh
set -eo pipefail
/usr/bin/mysqldump --user={{ matomo_db_user | quote }} \
--password={{ matomo_db_pass | quote }} \
--host={{ matomo_db_server | quote }} \

@ -21,6 +21,7 @@
shell: >
/usr/pgsql-13/bin/pg_dump
--clean
--create
--host={{ synapse_pg_db_server }}
--port={{ synapse_pg_db_port }}
--username=sqladmin {{ synapse_pg_db_name }} |

@ -1,4 +1,6 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
PGPASSWORD='{{ synapse_pg_db_pass }}' /usr/pgsql-13/bin/pg_dump \
--clean \

@ -43,6 +43,7 @@
command: >
/usr/pgsql-13/bin/pg_dump
--clean
--create
--host={{ mayan_db_server | quote }}
--port={{ mayan_db_port | quote }}
--username=sqladmin {{ mayan_db_name | quote }}

@ -1,4 +1,6 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
{% if mayan_db_engine == 'mysql' %}
/usr/bin/mysqldump --user={{ mayan_db_user | quote }} \
@ -7,8 +9,9 @@
--quick --single-transaction \
--add-drop-table {{ mayan_db_name | quote }} | zstd -c > {{ mayan_root_dir }}/backup/{{ mayan_db_name }}.sql.zst
{% else %}
PGPASSWORD='{{ mayan_db_pass }}' /usr/pgsql-13/bin/pg_dump \
PGPASSWORD={{ mayan_db_pass | quote }} /usr/pgsql-13/bin/pg_dump \
--clean \
--create \
--username={{ mayan_db_user | quote }} \
--host={{ mayan_db_server | quote }} \
{{ mayan_db_name | quote }} | \

@ -1,4 +1,6 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
/usr/bin/mysqldump \
{% if metabase_db_server not in ['localhost','127.0.0.1'] %}

@ -12,6 +12,7 @@
command: >
/usr/pgsql-13/bin/pg_dump
--clean
--create
--host={{ miniflux_db_server }}
--port={{ miniflux_db_port }}
--username={{ miniflux_db_user }}

@ -1,7 +1,10 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
PGPASSWORD='{{ miniflux_db_pass }}' /usr/pgsql-13/bin/pg_dump \
--clean \
--create \
--username={{ miniflux_db_user | quote }} \
--host={{ miniflux_db_server | quote }} \
{{ miniflux_db_name | quote }} | \

@ -1,4 +1,6 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
mkdir -p /home/lbkp/mongo
mongodump --username {{ mongo_admin_user }} --password {{ mongo_admin_pass | quote }} --quiet --port {{ mongo_port }} --out /home/lbkp/mongo

@ -1,6 +1,6 @@
#!/bin/sh
set -e
set -eo pipefail
# Get the .my.cnf from root
HOME=/root

@ -1,4 +1,6 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
/usr/bin/mysqldump \
{% if n8n_db_server not in ['localhost','127.0.0.1'] %}

@ -1,4 +1,6 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
sqlite3 {{ nd_root_dir }}/data/navidrome.db .dump | zstd -c > {{ nd_root_dir }}/backup/navidrome.sql.zst
cp {{ nd_root_dir }}/etc/navidrome.toml {{ nd_root_dir }}/backup/

@ -1,6 +1,8 @@
#!/bin/sh
PGPASSWORD={{ odoo_db_pass }} /usr/bin/pg_dump \
set -eo pipefail
PGPASSWORD={{ odoo_db_pass | quote }} /usr/bin/pg_dump \
--format=custom \
--clean \
--username={{ odoo_db_user }} \

@ -1,4 +1,6 @@
#!/bin/sh
set -eo pipefail
mkdir -p /home/lbkp/omv
cp /etc/openmediavault/* /home/lbkp/omv/

@ -1,4 +1,6 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
mkdir -p /home/lbkp/openproject
mount -o bind,ro {{ openproject_data_dir }}/backup /home/lbkp/openproject

@ -1,9 +1,11 @@
#!/bin/sh
set -eo pipefail
/usr/bin/mysqldump \
{% if pki_db_server not in [ '127.0.0.1', 'localhost' ] %}
--user={{ pki_db_user }} \
--password={{ pki_db_pass }} \
--password={{ pki_db_pass | quote }} \
--host={{ pki_db_server }} \
{% endif %}
--quick --single-transaction \

@ -1,11 +1,11 @@
---
# The version to deploy
paperless_version: 1.4.5
paperless_version: 1.5.0
# URL of the paperless archive
paperless_archive_url: https://github.com/jonaswinkler/paperless-ng/releases/download/ng-{{ paperless_version }}/paperless-ng-{{ paperless_version }}.tar.xz
# Expected checksum
paperless_archive_sha1: 4c989458c59890b9bd1dcd97a18e8bcb68280250
paperless_archive_sha1: edbbbfde6718ee7586acf1212d32ca379058cb15
# Should ansible handle install and upgrades, or only initial install
paperless_manage_upgrade: True
# Root directory where paperless will be installed

@ -27,6 +27,7 @@
command: >
/usr/pgsql-13/bin/pg_dump
--clean
--create
--host={{ paperless_db_server | quote }}
--port={{ paperless_db_port | quote }}
--username=sqladmin {{ paperless_db_name | quote }}

@ -47,3 +47,17 @@
- pass_file: "{{ paperless_root_dir }}/meta/ansible_admin_pass"
- set_fact: paperless_admin_pass={{ rand_pass }}
tags: ged
# Reset consumption dir to default if it doesn't exist
# This is useful when the consumption dir is from a network mount point but the mount
# isn't available yet when initializing paperless
- name: Check if consumption dir exists
stat: path={{ paperless_consume_dir }}
register: paperless_consume_dir_stat
become_user: "{{ paperless_user }}" # we check if paperless has access, root could be denied when using a FUSE FS for example
tags: ged
- name: Reset consumption dir to the default value
set_fact: paperless_consume_dir={{ paperless_root_dir }}/consume
when: not paperless_consume_dir_stat.stat.exists
tags: ged

@ -70,7 +70,7 @@
cd {{ paperless_root_dir }}/app/src
{{ paperless_root_dir }}/venv/bin/python ./manage.py $@
dest: /usr/local/bin/paperless
mode: 755
mode: 0755
tags: ged
- name: Install systemd units

@ -3,7 +3,7 @@
- name: Create system user
user:
name: "{{ paperless_user }}"
shell: /sbin/nologin
shell: /bin/false
home: "{{ paperless_root_dir }}"
system: True
tags: ged

@ -5,9 +5,12 @@ PAPERLESS_DBNAME={{ paperless_db_name }}
PAPERLESS_DBUSER={{ paperless_db_user }}
PAPERLESS_DBPASS={{ paperless_db_pass }}
PAPERLESS_CONSUMPTION_DIR={{ paperless_consume_dir }}
PAPERLESS_CONSUMER_POLLING=60
PAPERLESS_DATA_DIR={{ paperless_root_dir }}/data
PAPERLESS_MEDIA_ROOT={{ paperless_root_dir }}/media
PAPERLESS_STATICDIR={{ paperless_root_dir }}/static
PAPERLESS_CONVERT_TMPDIR={{ paperless_root_dir }}/tmp
PAPERLESS_SCRATCH_DIR={{ paperless_root_dir }}/tmp
PAPERLESS_FILENAME_FORMAT={created_year}/{created_month}/{title}
PAPERLESS_LOGGING_DIR={{ paperless_root_dir }}/log
PAPERLESS_SECRET_KEY={{ paperless_secret_key }}
@ -23,8 +26,6 @@ PAPERLESS_TIME_ZONE={{ system_tz }}
PAPERLESS_CONSUMER_DELETE_DUPLICATES=True
PAPERLESS_CONSUMER_RECURSIVE=True
PAPERLESS_CONSUMER_SUBDIRS_AS_TAGS=True
PAPERLESS_CONVERT_TMPDIR={{ paperless_root_dir }}/tmp
PAPERLESS_SCRATCH_DIR={{ paperless_root_dir }}/tmp
{% if paperless_auth_header is defined %}
PAPERLESS_ENABLE_HTTP_REMOTE_USER=True
PAPERLESS_HTTP_REMOTE_USER_HEADER_NAME={{ paperless_auth_header }}

@ -1,7 +1,10 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
PGPASSWORD='{{ paperless_db_pass }}' /usr/pgsql-13/bin/pg_dump \
--clean \
--create \
--username={{ paperless_db_user | quote }} \
--host={{ paperless_db_server | quote }} \
--port={{ paperless_db_port }} \

@ -21,3 +21,4 @@ paperless_packages:
- policycoreutils
- unpaper
- ghostscript
- postgresql13

@ -33,6 +33,7 @@
command: >
/usr/pgsql-13/bin/pg_dump
--clean
--create
--host={{ papermerge_db_server | quote }}
--port={{ papermerge_db_port | quote }}
--username=sqladmin {{ papermerge_db_name | quote }}

@ -1,4 +1,6 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
/usr/bin/systemd-cat /usr/bin/pmgbackup backup
cp -a /etc/opendkim/keys /home/lbkp/pmg/

@ -1,4 +1,6 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
DEST=/home/lbkp/pgsql

@ -28,6 +28,7 @@
command: >
/usr/pgsql-13/bin/pg_dump
--clean
--create
--host={{ psono_db_server }}
--port={{ psono_db_port }}
--username=sqladmin {{ psono_db_name }}

@ -1,7 +1,10 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
PGPASSWORD='{{ psono_db_pass }}' /usr/pgsql-11/bin/pg_dump \
--clean \
--create \
--username={{ psono_db_user }} \
--host={{ psono_db_server }} \
{{ psono_db_name }} | \

@ -1,4 +1,6 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
{% if rabbitmq_conf == 'rabbitmq.conf' %}
mkdir -p /home/lbkp/rabbitmq/

@ -1,6 +1,6 @@
#!/bin/sh
set -e
set -eo pipefail
DEST=/home/lbkp/redis

@ -1,18 +1,22 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
LDB_MODULES_PATH=/usr/lib64/samba/ldb
export LDB_MODULES_PATH
mkdir -p /home/lbkp/samba/{private,ldif/sam.ldb.d,gpo}
tar cf /home/lbkp/samba/sysvol.tar.lz4 --use-compress-program=lz4 -C /var/lib/samba/sysvol .
mkdir -p /home/lbkp/samba/{private,ldif/sam.ldb.d,offline}
tar cf /home/lbkp/samba/sysvol.tar.zst --use-compress-program=zstd -C /var/lib/samba/sysvol .
find /var/lib/samba/private/ -type f -name \*.ldb | xargs tdbbackup
pushd /var/lib/samba/private/ > /dev/null
find . -type f -name \*.bak | xargs cp --parents -t /home/lbkp/samba/private/
popd > /dev/null
find /var/lib/samba/private -type f -name \*.bak | xargs rm -f
find /home/lbkp/samba/private/ -type f -name \*.bak | while read F; do mv "$F" "${F%.bak}"; done
tar cf /home/lbkp/samba/private.tar.lz4 --use-compress-program=lz4 -C /home/lbkp/samba/private .
tar cf /home/lbkp/samba/private.tar.zst --use-compress-program=zstd -C /home/lbkp/samba/private .
rm -rf /home/lbkp/samba/private/
for LDIF in $(find /var/lib/samba/private/ -type f -name \*.ldb); do
ldbsearch --url=$LDIF | lz4 -c > /home/lbkp/samba/ldif/$(echo $LDIF | sed -e 's/\/var\/lib\/samba\/private//').ldif.lz4
ldbsearch --url=$LDIF | zstd -c > /home/lbkp/samba/ldif/$(echo $LDIF | sed -e 's/\/var\/lib\/samba\/private//').ldif.zst
done
# Also take a more standard offline backup
samba-tool domain backup offline --targetdir=/home/lbkp/samba/offline/

@ -1,12 +1,14 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
# Dump Databases
for DB in {{ seafile_db_ccnet }} {{ seafile_db_seafile }} {{ seafile_db_seahub }}; do
/usr/bin/mysqldump \
--quick --single-transaction \
{% if seafile_db_server not in ['127.0.0.1', 'localhost'] %}
--user='{{ seafile_db_user }}' \
--password='{{ seafile_db_pass }}' \
--user={{ seafile_db_user }} \
--password={{ seafile_db_pass | quote }} \
--host={{ seafile_db_server }} \
{% endif %}
--add-drop-table $DB | zstd -T0 -c > {{ seafile_root_dir }}/backup/$DB.sql.zst

@ -1,4 +1,6 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
mkdir -p {{ unifi_root_dir }}/backup/mongo
mongodump --quiet --port 27117 --out {{ unifi_root_dir }}/backup/mongo

@ -1,13 +1,15 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
mkdir -p /home/lbkp/vaultwarden/
cp {{ vaultwarden_root_dir }}/data/rsa* {{ vaultwarden_root_dir }}/backup/
{% if vaultwarden_db_engine == 'mysql' %}
/usr/bin/mysqldump \
{% if vaultwarden_db_server != 'localhost' and vaultwarden_db_server != '127.0.0.1' %}
--user='{{ vaultwarden_db_user }}' \
--password='{{ vaultwarden_db_pass }}' \
--host='{{ vaultwarden_db_server }}' \
{% if vaultwarden_db_server not in ['localhost', '127.0.0.1'] %}
--user={{ vaultwarden_db_user }} \
--password={{ vaultwarden_db_pass | quote }} \
--host={{ vaultwarden_db_server }} \
{% endif %}
--quick --single-transaction \
--add-drop-table {{ vaultwarden_db_name }} | zstd -c > {{ vaultwarden_root_dir }}/backup/{{ vaultwarden_db_name }}.sql.zst

@ -1,5 +1,7 @@
#!/bin/sh
set -eo pipefail
PGPASSWORD={{ wapt_db_pass | quote }} /usr/pgsql-13/bin/pg_dump \
--clean \
--create \

@ -1,12 +1,14 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
/usr/bin/mysqldump \
{% if not wp_db_server in ['localhost', '127.0.0.1'] %}
--user='{{ wp_db_user }}' \
--password='{{ wp_db_pass }}' \
--host='{{ wp_db_server }}' \
--port='{{ wp_db_port }}' \
--user={{ wp_db_user }} \
--password={{ wp_db_pass | quote }} \
--host={{ wp_db_server }} \
--port={{ wp_db_port }} \
{% endif %}
--quick --single-transaction \
--add-drop-table '{{ wp_db_name }}' | zstd -c > {{ wp_root_dir }}/backup/{{ wp_db_name }}.sql.zst
--add-drop-table {{ wp_db_name }} | zstd -c > {{ wp_root_dir }}/backup/{{ wp_db_name }}.sql.zst

@ -1,4 +1,6 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
{% if zabbix_server_backup_hooks %}
mkdir -p /home/lbkp/zabbix

@ -1,4 +1,6 @@
#!/bin/bash -e
#!/bin/sh
set -eo pipefail
mkdir -p /home/lbkp/zimbra/mount

Loading…
Cancel
Save