Restic is a foss tool for managing incremental file backups across multiple computers.
Configuring Restic
Create a location for your backup. I like BackBlaze although they are US based (your data is encrypted with AES-256)
Create a restic env file .resticenv
export RESTIC_REPOSITORY="b2:<bucketname>:<appname>"
export B2_ACCOUNT_KEY=<your_account_key>
export B2_ACCOUNT_ID=<your_account_id>
export PWFILE=/path/to/your/resticpw
Create the file pointed to from PWFILE
and add your restic encryption password
#!/bin/bash
source /abs/path/to/.resticenv
RESTIC=/mnt/user/appdata/restic/bin/restic
echo "create mysql backup"
/usr/local/bin/docker-compose -f /mnt/user/Docker/wiki/docker-compose.yml run db_bak /bin/bash /backup/mysql_backup.sh
echo "back up mysql dump and wiki files"
${RESTIC} -p ${PWFILE} backup /mnt/user/Docker/wiki/backup/backup.sql /mnt/user/Docker/wiki/config
${RESTIC} forget \
--keep-daily 30 \
--keep-monthly 12 \
--keep-yearly 10 \
-p ${PWFILE}