Skip to content
Snippets Groups Projects
Commit 9ee26955 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

Customize restic backup settings

parent bbde5137
Branches
No related tags found
1 merge request!118Customize restic backup settings
......@@ -3,8 +3,6 @@ Here you can set custom environment variables.
A common usage is extending the variable PATH to execute binaries that are not located in any directory.
WIP: Or you can override used parameters during backup. The parameters for mysqldump are in env_defaults. If you want to change them then put ``LD_MYSQL_DUMP_PARAMS=...`` into env file.
Example:
This might be helpful on MS Windows. If you put the restic binary "somewhere" eg. c:\portable\restic\restic.exe then you can add the path to the env file:
......@@ -12,3 +10,62 @@ This might be helpful on MS Windows. If you put the restic binary "somewhere" eg
```bash
PATH=/c/portable/restic/:$PATH
```
## Override parameters
In the file ``jobs/env_defaults`` are some vars to set some defaults for the command lines during backup.
Do not edit this file - it is part of the repository. To customize a value copy it to ``jobs/env`` and make your changes there.
```bash
#!/bin/bash
# ----------------------------------------------------------------------
#
# DEFAULTS !!! Do not edit this file !!!
# Overide customizations in file "env" (maybe copy env.dist to env first)
#
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# Localdump
# ----------------------------------------------------------------------
# mysql
LD_MYSQL_DUMP_PARAMS="--opt \
--default-character-set=utf8 \
--flush-logs \
--single-transaction \
--no-autocommit \
"
# ----------------------------------------------------------------------
# Restic backup
# ----------------------------------------------------------------------
# compression mode (only available for repository format version 2), one of (auto|off|max) (default: $RESTIC_COMPRESSION) (default auto)
# export RESTIC_COMPRESSION=auto
# Concurrency for file reads (default: 2)
# RESTIC_READ_CONCURRENCY=
# Target size for pack files
export RESTIC_PACK_SIZE=128
# injected in command line for restic backup (not a variable of restic)
RESTIC_PARAMS=--no-scan
# ----------------------------------------------------------------------
```
### Localdump :: Mysql
You can override used parameters during backup. The parameters for mysqldump are in env_defaults. If you want to change them then put ``LD_MYSQL_DUMP_PARAMS=...`` into env file.
### Transfer :: Restic
There are some environment variables for tuning
* RESTIC_COMPRESSION
* RESTIC_READ_CONCURRENCY
* RESTIC_PACK_SIZE
see <https://restic.readthedocs.io/en/latest/047_tuning_backup_parameters.html>
\ No newline at end of file
......@@ -18,4 +18,20 @@ LD_MYSQL_DUMP_PARAMS="--opt \
--no-autocommit \
"
# ----------------------------------------------------------------------
# Restic backup
# ----------------------------------------------------------------------
# compression mode (only available for repository format version 2), one of (auto|off|max) (default: $RESTIC_COMPRESSION) (default auto)
export RESTIC_COMPRESSION=auto
# Concurrency for file reads (default: 2)
RESTIC_READ_CONCURRENCY=8
# Target size for pack files
export RESTIC_PACK_SIZE=128
# injected in command line for restic backup (not a variable of restic)
RESTIC_PARAMS=--no-scan
# ----------------------------------------------------------------------
\ No newline at end of file
......@@ -245,7 +245,7 @@
}
function t_backupDirGetCmdBackup(){
echo eval restic backup ${ARGS_DEFAULT} ${ARGS_BACKUP} ${mydir}
echo eval restic backup ${ARGS_DEFAULT} ${ARGS_BACKUP} ${RESTIC_PARAMS} ${mydir}
}
# pre backup actions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment