changed to debian and added cron
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "duplicacy",
|
||||
"version": "20201117.13",
|
||||
"version": "20201117.14",
|
||||
"slug": "duplicacy",
|
||||
"description": "Duplicacy backup",
|
||||
"arch": ["armhf", "armv7"],
|
||||
@@ -15,6 +15,7 @@
|
||||
"ssh_password": "password",
|
||||
"server": "server.example.com",
|
||||
"path": "/opt/some/folder/on/on/server",
|
||||
"crontab_run": "*/5 * * * *",
|
||||
"filters": [
|
||||
"i:addons/.*",
|
||||
"i:backup/.*",
|
||||
@@ -30,6 +31,7 @@
|
||||
"ssh_password": "str",
|
||||
"server": "str",
|
||||
"path": "str",
|
||||
"crontab_run": "str",
|
||||
"filters": ["match(^i:|e:)"]
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
ARG BUILD_FROM
|
||||
FROM $BUILD_FROM
|
||||
ARG BUILD_FROM=debian:buster-20201012-slim
|
||||
FROM ${BUILD_FROM}
|
||||
|
||||
ENV LANG C.UTF-8
|
||||
|
||||
# Install cron
|
||||
RUN apt-get -y install -qq --force-yes cron
|
||||
|
||||
# Copy data for add-on
|
||||
COPY run.sh /
|
||||
COPY duplicacy_linux_arm_2.7.2 /duplicacy
|
||||
|
||||
@@ -12,6 +12,7 @@ SSH_PASSWORD=$(jq --raw-output ".ssh_password" $CONFIG_PATH)
|
||||
BACKUP_SERVER=$(jq --raw-output ".server" $CONFIG_PATH)
|
||||
BACKUP_SERVER_PATH=$(jq --raw-output ".path" $CONFIG_PATH)
|
||||
FILTERS=$(jq --raw-output ".filters" $CONFIG_PATH)
|
||||
CRONTAB_RUN=$(jq --raw-output ".crontab_run" $CONFIG_PATH)
|
||||
|
||||
# edit the /.duplicacy/preferences file
|
||||
sed --in-place 's/<BACKUP_ID>/'${BACKUP_ID}'/' /.duplicacy/preferences
|
||||
@@ -24,8 +25,14 @@ sed --in-place 's~<BACKUP_SERVER_PATH>~'${BACKUP_SERVER_PATH}'~' /.duplicacy/pre
|
||||
# create the filters file
|
||||
echo ${FILTERS} | jq -r '.[]' >> /.duplicacy/filters
|
||||
|
||||
# backup all the data
|
||||
#/duplicacy -verbose -log backup -stats
|
||||
|
||||
# testing snaphots
|
||||
ha sn list
|
||||
# backup all the data using cron
|
||||
echo "${CRONTAB_RUN} /duplicacy -verbose -log backup -stats" >> /etc/cron.d/duplicacy
|
||||
# Give execution rights on the cron job
|
||||
chmod 0644 /etc/cron.d/duplicacy
|
||||
# Apply cron job
|
||||
crontab /etc/cron.d/duplicacy
|
||||
# Create the log file to be able to run tail
|
||||
touch /var/log/cron.log
|
||||
# Run the command on container startup
|
||||
cron && tail -f /var/log/cron.log
|
||||
Reference in New Issue
Block a user