Table of Contents
If a file env
exists in the folder ./jobs/
it will be sourced by the backup scripts.
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.
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:
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.
#!/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