Skip to content

Commit

Permalink
Merge pull request #3 from stakater-docker/update-run
Browse files Browse the repository at this point in the history
Update run
  • Loading branch information
usamaahmadkhan authored Feb 6, 2020
2 parents f5c505c + 4f406e5 commit 0634207
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,21 @@ ln -s /listbackups.sh /usr/bin/listbackups

touch /mongo_backup.log

if [[ "$INIT_BACKUP" == "true" ]]; then
if [[ "${INIT_BACKUP}" == "true" ]]; then
echo "=> Create a backup on the startup"
/backup.sh
fi

if [[ "$INIT_RESTORE" == "true" ]]; then
if [[ "${INIT_RESTORE}" == "true" ]]; then
echo "=> Restore store from lastest backup on startup"
/restore.sh
fi

if [[ "$DISABLE_CRON" == "true" ]]; then
if [[ "${DISABLE_CRON}" == "true" ]]; then
echo "${CRON_TIME} . /root/project_env.sh; /backup.sh >> /mongo_backup.log 2>&1" > /crontab.conf
crontab /crontab.conf
echo "=> Running cron job"
cron && tail -f /mongo_backup.log
cron
fi

tail -f /mongo_backup.log

0 comments on commit 0634207

Please sign in to comment.