Skip to content

Commit

Permalink
Call crontab-l only if it doesn't return an error.
Browse files Browse the repository at this point in the history
  • Loading branch information
srnjak committed Oct 26, 2023
1 parent 72f3c02 commit 00e55fe
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ set -e
case "$1" in
configure)
# Add the cronjob to the current user's crontab
# (crontab -l ; echo "0 0 * * * /usr/share/purge-backups/purge-backups-scheduler") | crontab -
(echo "0 0 * * * /usr/share/purge-backups/purge-backups-scheduler") | crontab -
(crontab -l 2>/dev/null || true; echo "0 0 * * * /usr/share/purge-backups/purge-backups-scheduler") | crontab -
;;
*)
# Do nothing on other actions
Expand Down

0 comments on commit 00e55fe

Please sign in to comment.