Update cron jobs and scripts.

This commit is contained in:
Darren 'Tadgy' Austin 2022-08-17 18:31:57 +01:00
commit e482a0eda1
4 changed files with 18 additions and 5 deletions

View file

@ -0,0 +1 @@
25 3 * * * [ -x /usr/bin/dehydrated ] && /usr/bin/dehydrated -c >/dev/null

View file

@ -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")" 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")" 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\n'}$TEMPLATESTATUS"
mailx "${MAILX_ARGS[@]}" -r "$EMAIL_FROM" -s "/etc git status" "${EMAIL_TO[@]}" <<< "${ETCSTATUS:+$ETCSTATUS$'\n'}$TEMPLATESTATUS"

View 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"

View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Sleep for a couple of minutes to prevent a race condition with other cron jobs. # Sleep for up to a couple of minutes to prevent a race condition with other cron jobs.
sleep 120 sleep $(( RANDOM % 120 ))
# Secure /var/log # Secure /var/log
shopt -s globstar shopt -s globstar