.
This commit is contained in:
@@ -1,9 +1,10 @@
|
|||||||
#check ../README.md for more information
|
#check ../README.md for more information
|
||||||
|
|
||||||
FROM duplicati/duplicati
|
FROM duplicati/duplicati
|
||||||
RUN apt update && apt install -y default-mysql-client && rm -rf /var/lib/apt/lists/*
|
RUN apt update && apt install -y default-mysql-client && rm -rf /var/lib/apt/lists/*
|
||||||
RUN mkdir duplicati-mysqlclient
|
|
||||||
RUN mkdir duplicati-mysqlclient/scripts
|
|
||||||
COPY /docker/mysqlclient/scripts/* /duplicati-mysqlclient/scripts/
|
COPY /scripts/* /usr/local/bin
|
||||||
RUN chmod +x /duplicati-mysqlclient/scripts/*
|
RUN chmod +x /usr/local/bin/duplicati-influxdb-notify
|
||||||
|
RUN chmod +x /usr/local/bin/duplicati-mysql-backup
|
||||||
|
|
||||||
EXPOSE 8200
|
EXPOSE 8200
|
||||||
@@ -58,3 +58,20 @@ volumes:
|
|||||||
duplicati-data:
|
duplicati-data:
|
||||||
db-dumps:
|
db-dumps:
|
||||||
````
|
````
|
||||||
|
### Transfer To another system
|
||||||
|
1. Copy docker compose and execute on another system
|
||||||
|
2. Check volumes and service started succesfully
|
||||||
|
3. Stop all compose services
|
||||||
|
4. Change volume on duplicati service to user a temporary volume example (duclicati_tmpdata)
|
||||||
|
5. Check if all volumes are writable on duplication service
|
||||||
|
6. Start only the duplicati service (with temporary volume) on target system
|
||||||
|
7. On source system Stop app services on docker compose except duplicati
|
||||||
|
8. Execute a full backup ou source system
|
||||||
|
9. On target system execute a manual restore to original destination
|
||||||
|
10. Stop duplicati
|
||||||
|
11. Change duplicati to use original volume
|
||||||
|
12. And change volumes on duplicati to RO
|
||||||
|
13. Start all services
|
||||||
|
14. Check everything ok
|
||||||
|
|
||||||
|
### Environment Variables
|
||||||
94
scripts/duplicati-influxdb-notify
Normal file
94
scripts/duplicati-influxdb-notify
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#/etc/default/influxdb-connection example
|
||||||
|
#INFLUDB_SERVER=http://192.168.1.201:8086
|
||||||
|
#INFLUDB_BUCKET=bucketname
|
||||||
|
#INFLUDB_ORG=orgname
|
||||||
|
#INFLUDB_TOKEN=Token xxxx
|
||||||
|
if [ -f "/etc/default/duplicati-influxdb" ]; then
|
||||||
|
export $(cat /etc/default/duplicati-influxdb)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "~/.config/duplicati-influxdb" ]; then
|
||||||
|
export $(cat ~/default/duplicati-influxdb)
|
||||||
|
fi
|
||||||
|
|
||||||
|
#duplicati
|
||||||
|
#DUPLICATI__EVENTNAME="zbf dc fbz"
|
||||||
|
#DUPLICATI__OPERATIONNAME="yy"
|
||||||
|
#DUPLICATI__PARSED_RESULT="p gfh uasd"
|
||||||
|
#DUPLICATI__backup_name="puggb"
|
||||||
|
#DUPLICATI__RESULTFILE="sd gasd"
|
||||||
|
#DUPLICATI__LOCALPATH="sagd"
|
||||||
|
#
|
||||||
|
|
||||||
|
TAGS=""
|
||||||
|
MESSAGE_FIELD_VALUE=""
|
||||||
|
|
||||||
|
|
||||||
|
UNSCAPED=""
|
||||||
|
ESCAPED=""
|
||||||
|
|
||||||
|
escape_tag_str () {
|
||||||
|
ESCAPED=${UNSCAPED//[ ]/\\ }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if [[ ! -z "$HOSTNAME" ]]; then
|
||||||
|
UNSCAPED=$HOSTNAME
|
||||||
|
escape_tag_str
|
||||||
|
TAGS="${TAGS},host=${ESCAPED}"
|
||||||
|
MESSAGE_FIELD_VALUE="${MESSAGE_FIELD_VALUE} ${HOSTNAME}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -z "$DUPLICATI__EVENTNAME" ]]; then
|
||||||
|
UNSCAPED=$DUPLICATI__EVENTNAME
|
||||||
|
escape_tag_str
|
||||||
|
TAGS="${TAGS},eventName=\"${ESCAPED}\""
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -z "$DUPLICATI__OPERATIONNAME" ]]; then
|
||||||
|
UNSCAPED=$DUPLICATI__OPERATIONNAME
|
||||||
|
escape_tag_str
|
||||||
|
TAGS="${TAGS},operationName=${ESCAPED}"
|
||||||
|
MESSAGE_FIELD_VALUE="${MESSAGE_FIELD_VALUE} ${DUPLICATI__OPERATIONNAME}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -z "$DUPLICATI__backup_name" ]]; then
|
||||||
|
UNSCAPED=$DUPLICATI__backup_name
|
||||||
|
escape_tag_str
|
||||||
|
TAGS="${TAGS},backupName=${ESCAPED}"
|
||||||
|
MESSAGE_FIELD_VALUE="${MESSAGE_FIELD_VALUE} ${DUPLICATI__backup_name}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -z "$DUPLICATI__PARSED_RESULT" ]]; then
|
||||||
|
UNSCAPED=$DUPLICATI__PARSED_RESULT
|
||||||
|
escape_tag_str
|
||||||
|
TAGS="${TAGS},status=${ESCAPED}"
|
||||||
|
MESSAGE_FIELD_VALUE="${MESSAGE_FIELD_VALUE} ${DUPLICATI__PARSED_RESULT}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -z "$DUPLICATI__RESULTFILE" ]]; then
|
||||||
|
UNSCAPED=$DUPLICATI__RESULTFILE
|
||||||
|
escape_tag_str
|
||||||
|
TAGS="${TAGS},resultFile=${ESCAPED}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -z "$DUPLICATI__LOCALPATH" ]]; then
|
||||||
|
UNSCAPED=$DUPLICATI__LOCALPATH
|
||||||
|
escape_tag_str
|
||||||
|
TAGS="${TAGS},localPath=${ESCAPED}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
FIELDS="message=\"Duplicati ${MESSAGE_FIELD_VALUE}\""
|
||||||
|
#echo $TAGS
|
||||||
|
|
||||||
|
curl --request POST \
|
||||||
|
"$INFLUXDB_SERVER/write?db=$INFLUXDB_BUCKET&ORG=$INFLUXDB_ORG" \
|
||||||
|
--header "Authorization: Token $INFLUXDB_TOKEN" \
|
||||||
|
--header "Content-Type: text/plain; charset=utf-8" \
|
||||||
|
--header "Accept: application/json" \
|
||||||
|
--data-raw "duplicati${TAGS} ${FIELDS}" > /dev/null 2>&1
|
||||||
|
|
||||||
|
exit 0
|
||||||
Reference in New Issue
Block a user