From 735d661aa2894db75833445d568a41950a7d6428 Mon Sep 17 00:00:00 2001 From: Matthew McKinnon Date: Mon, 6 May 2024 00:41:42 +1000 Subject: [PATCH] fix: updated diskalert smtp server --- diskalert | 2 +- dockerdata | 51 --------------------------------------------------- 2 files changed, 1 insertion(+), 52 deletions(-) delete mode 100755 dockerdata diff --git a/diskalert b/diskalert index 4ff1fe1..fbde460 100755 --- a/diskalert +++ b/diskalert @@ -8,7 +8,7 @@ MAILTO="support@comprofix.com" MAILFROM="support@comprofix.com" THISSERVER=$(hostname -f) -SMTP="mail.comprofix.com" +SMTP="comprofix-com.mail.protection.outlook.com" LOGFILE="/var/log/diskalert.log" THISSERVER=$(hostname -f) diff --git a/dockerdata b/dockerdata deleted file mode 100755 index bcd9146..0000000 --- a/dockerdata +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -# Script Name: dbbackup -# Author: Matt McKinnon -# Date: 7th June 2016 -# Description: -# This script will backup your mysql databases. -# Send an email report of databases that have been backed up. -# Rotate backups for 7 days -# -# NOTE: -# A user will need to be grated permissions on the databases -# Login to mysql with your root user. -# -# CREATE USER 'dbbackup'@'localhost' IDENTIFIED BY 'PASSWORD'; -# GRANT LOCK TABLES, SELECT, SHOW VIEW, RELOAD, REPLICATION CLIENT, EVENT, TRIGGER ON *.* TO 'dbbackup'@'localhost'; - - -MAILTO="support@comprofix.com" -MAILFROM="support@comprofix.com" -SMTP="comprofix-com.mail.protection.outlook.com" - -BAKDATE=$(date +%Y%m%d) -SUBJECT="Docker data backup completed - $BAKDATE" -BACKUPDIR='/mnt/nfs/archive/dockerdata/' -LOG="/tmp/dockerdata-backup.log" -MESSAGE="/tmp/message.log" - -touch $LOG -touch $MESSAGE - -rotate_backups() { - find $BACKUPDIR -type f -mtime +7 -exec rm -frv {} \; - -} - -rotate_backups - -folders=$(find /mnt/nfs/docker/ -maxdepth 1 -mindepth 1 -type d) - -for folder in $folders; do - echo "Archiving $folder" >> $MESSAGE - tar -Pzcvf $BACKUPDIR/${folder##*/}-$BAKDATE.tar.gz $folder &>> $LOG -done - - -sendemail -o tls=yes -s $SMTP -t $MAILTO -f "$SQLSERVER <$MAILFROM>" -u "$SUBJECT" -m "$(cat $MESSAGE)" -a $LOG -q - -#Use Below to use systems postfix or local MTA -#cat /tmp/backup.msg | mail -s "$SUBJECT" "$MAIL" -rm $MESSAGE -rm $LOG