Update cron jobs and scripts.
This commit is contained in:
parent
5531de0f11
commit
e482a0eda1
4 changed files with 18 additions and 5 deletions
1
base-files/cron.d/dehydrated
Normal file
1
base-files/cron.d/dehydrated
Normal file
|
|
@ -0,0 +1 @@
|
|||
25 3 * * * [ -x /usr/bin/dehydrated ] && /usr/bin/dehydrated -c >/dev/null
|
||||
|
|
@ -5,7 +5,6 @@ source /etc/mail.conf "etc-git" || exit 1
|
|||
ETCSTATUS="$(cd /etc && git status | egrep -ve "^(On branch|Your branch|No commits|nothing|$)" -e "\(use")"
|
||||
TEMPLATESTATUS="$(cd /etc/slackpkg/templates && git status | egrep -ve "^(On branch|Your branch|No commits|nothing|$)" -e "\(use")"
|
||||
|
||||
[[ -z "$ETCSTATUS" ]] && [[ -z "$TEMPLATESTATUS" ]] && exit 0
|
||||
|
||||
[[ ! -z "$ETCSTATUS" ]] || [[ ! -z "$TEMPLATESTATUS" ]] && {
|
||||
|
||||
mailx "${MAILX_ARGS[@]}" -r "$EMAIL_FROM" -s "/etc git status" "${EMAIL_TO[@]}" <<< "${ETCSTATUS:+$ETCSTATUS$'\n'}$TEMPLATESTATUS"
|
||||
mailx "${MAILX_ARGS[@]}" -r "$EMAIL_FROM" -s "/etc git status" "${EMAIL_TO[@]}" <<< "${ETCSTATUS:+$ETCSTATUS$'\n\n'}$TEMPLATESTATUS"
|
||||
|
|
|
|||
13
base-files/cron.daily/warn-smtp-queue
Executable file
13
base-files/cron.daily/warn-smtp-queue
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
source /etc/mail.conf "mail-queue" || exit 1
|
||||
|
||||
hash mailq 2>/dev/null || exit 0
|
||||
|
||||
sleep $(( RANDOM % 180 ))
|
||||
|
||||
QUEUE="$(mailq)"
|
||||
|
||||
[[ -z "$QUEUE" ]] && exit 0
|
||||
|
||||
mailx "${MAILX_ARGS[@]}" -r "$EMAIL_FROM" -s "Mail queue" "${EMAIL_TO[@]}" <<< "$QUEUE"
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Sleep for a couple of minutes to prevent a race condition with other cron jobs.
|
||||
sleep 120
|
||||
# Sleep for up to a couple of minutes to prevent a race condition with other cron jobs.
|
||||
sleep $(( RANDOM % 120 ))
|
||||
|
||||
# Secure /var/log
|
||||
shopt -s globstar
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue