kopia lustrzana https://github.com/borgmatic-collective/docker-borgmatic
Allow running as binary without cron
Signed-off-by: Chirag Aggarwal <thechiragaggarwal@gmail.com>pull/244/head
rodzic
e7f1635626
commit
b0964aba6d
|
@ -38,4 +38,4 @@ COPY --link requirements.txt /
|
|||
RUN python3 -m pip install --no-cache -Ur requirements.txt
|
||||
RUN borgmatic --bash-completion > /usr/share/bash-completion/completions/borgmatic && echo "source /etc/profile.d/bash_completion.sh" > /root/.bashrc
|
||||
|
||||
CMD ["/entry.sh"]
|
||||
ENTRYPOINT ["/entry.sh"]
|
||||
|
|
25
entry.sh
25
entry.sh
|
@ -10,14 +10,23 @@ echo borgmatic $borgmaticver
|
|||
echo $borgver
|
||||
echo apprise $apprisever
|
||||
|
||||
# Test crontab
|
||||
supercronic -test /etc/borgmatic.d/crontab.txt || exit 1
|
||||
if [ $# -eq 0 ]; then
|
||||
# Test crontab
|
||||
supercronic -test /etc/borgmatic.d/crontab.txt || exit 1
|
||||
|
||||
# Start supercronic
|
||||
if [ -n "${SUPERCRONIC_EXTRA_FLAGS}" ]; then
|
||||
echo "The variable SUPERCRONIC_EXTRA_FLAGS is not empty, using extra flags"
|
||||
supercronic $SUPERCRONIC_EXTRA_FLAGS /etc/borgmatic.d/crontab.txt
|
||||
# Start supercronic
|
||||
if [ -n "${SUPERCRONIC_EXTRA_FLAGS}" ]; then
|
||||
echo "The variable SUPERCRONIC_EXTRA_FLAGS is not empty, using extra flags"
|
||||
supercronic $SUPERCRONIC_EXTRA_FLAGS /etc/borgmatic.d/crontab.txt
|
||||
else
|
||||
echo "The variable SUPERCRONIC_EXTRA_FLAGS is empty, starting normally"
|
||||
supercronic /etc/borgmatic.d/crontab.txt
|
||||
fi
|
||||
else
|
||||
echo "The variable SUPERCRONIC_EXTRA_FLAGS is empty, starting normally"
|
||||
supercronic /etc/borgmatic.d/crontab.txt
|
||||
if [ "$1" = "bash" ] || [ "$1" = "sh" ] || [ "$1" = "/bin/bash" ] || [ "$1" = "/bin/sh" ]; then
|
||||
exec "$@"
|
||||
else
|
||||
borgmatic "$@"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue