Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

* Apply CRON rules ONLY if RESTORE = false #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ if [[ "$RESTORE" == "true" ]]; then
./restore.sh
else
./backup.sh
fi

if [ -n "$CRON_TIME" ]; then
echo "${CRON_TIME} /backup.sh >> /dockup.log 2>&1" > /crontab.conf
crontab /crontab.conf
echo "=> Running dockup backups as a cronjob for ${CRON_TIME}"
exec cron -f
fi
if [ -n "$CRON_TIME" ]; then
echo "${CRON_TIME} /backup.sh >> /dockup.log 2>&1" > /crontab.conf
crontab /crontab.conf
echo "=> Running dockup backups as a cronjob for ${CRON_TIME}"
exec cron -f
fi

fi