Skip to content

Commit

Permalink
Merge pull request #2 from freol35241/fix/multiple-executions-fix
Browse files Browse the repository at this point in the history
Replacing root's crontab instead of appending
  • Loading branch information
msiegenthaler authored Jun 7, 2023
2 parents 22cb95a + 8188a5f commit 1e115b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ if [ -d "/etc/periodic/${LOGROTATE_CRON:-15min}" ]; then
echo "using /etc/periodic/${LOGROTATE_CRON:-15min} cron schedule" | ts "${TS_FORMAT}"
mv /etc/.logrotate.cronjob "/etc/periodic/${LOGROTATE_CRON:-15min}/logrotate"
else
echo "assuming \"${LOGROTATE_CRON:-15min}\" is a cron expression; appending to root's crontab" | ts "${TS_FORMAT}"
echo "${LOGROTATE_CRON:-15min} /etc/.logrotate.cronjob" >> /var/spool/cron/crontabs/root
echo "assuming \"${LOGROTATE_CRON:-15min}\" is a cron expression; replacing root's crontab" | ts "${TS_FORMAT}"
echo "${LOGROTATE_CRON:-15min} /etc/.logrotate.cronjob" > /var/spool/cron/crontabs/root
fi

# shellcheck disable=SC2086
Expand Down

0 comments on commit 1e115b6

Please sign in to comment.