Skip to content
Snippets Groups Projects
Commit de7dd11d authored by Dmitriy Safronov's avatar Dmitriy Safronov
Browse files

rsync-sync

parent 24b4b1c5
No related branches found
No related tags found
Loading
FROM registry.cyberbrain.pw/docker/git-sync:latest
ENV GIT_SYNC_HTTP_METRICS=false GIT_SYNC_ROOT='/tmp/git' GIT_SYNC_DEST='config' GIT_SYNC_EXECHOOK_COMMAND='/ha-rsync' GIT_SYNC_ADD_USER='true'
ENV GIT_SYNC_HTTP_METRICS=false \
GIT_SYNC_ROOT='/tmp/git' \
GIT_SYNC_DEST='sync' \
GIT_SYNC_EXECHOOK_COMMAND='/rsync-sync' \
GIT_SYNC_ADD_USER='true'
USER root:root
......@@ -11,11 +15,11 @@ RUN set -ex \
&& rm -rf /var/lib/apt/lists/* \
&& chmod -Rv 0777 "${GIT_SYNC_ROOT:-/tmp/git}/"
COPY ha-rsync* /
COPY rsync-sync* /
RUN set -ex \
&& chmod a+x /ha-rsync
&& chmod a+x /rsync-sync
VOLUME ["/config"]
VOLUME ["/sync"]
USER 65533:65533
# Git Sync - Home Assistant
# Git Sync - Rsync Sync
Warning! Default excludes could change suddenly and with no reason)
#!/usr/bin/env sh
rsync -a \
--exclude-from='/ha-rsync.excludes' \
--exclude='/.git' \
--exclude='/.HA_VERSION' \
--exclude='/secrets.yaml' \
--delete-after \
"${GIT_SYNC_ROOT:-/tmp/git}/${GIT_SYNC_DEST:-config}/" \
/config
# Don't overwrite files created from UI
/automations.yaml
/scenes.yaml
/scripts.yaml
# Don't overwrite cloud connection settings
/.cloud/*
# Don't overwrite local settings
/.storage/*
# Don't overwrite local dirs
/deps
/image
/tts
#!/usr/bin/env sh
rsync -a \
--exclude-from='/rsync-sync.excludes' \
--exclude='/.git' \
--delete-after \
"${GIT_SYNC_ROOT:-/tmp/git}/${GIT_SYNC_DEST:-sync}/" \
/sync
# Placeholder for your own excludes. Just mount your file into conteiner as /rsync-sync.excludes
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment