最初コミット
This commit is contained in:
38
mail.076.ne.jp/crontab
Normal file
38
mail.076.ne.jp/crontab
Normal file
@@ -0,0 +1,38 @@
|
||||
MAILTO=suwako
|
||||
* * * * * echo "Test" > /tmp/cron_test.txt
|
||||
|
||||
30 3 * * * /bin/bash /var/vmail/backup/backup_mysql.sh
|
||||
|
||||
# iRedAPD: Clean up expired tracking records hourly.
|
||||
1 * * * * python3 /opt/iredapd/tools/cleanup_db.py >/dev/null
|
||||
|
||||
# iRedAPD: Convert SPF DNS record of specified domain names to IP
|
||||
# addresses/networks hourly.
|
||||
2 * * * * python3 /opt/iredapd/tools/spf_to_greylist_whitelists.py >/dev/null
|
||||
|
||||
# iRedMail: Cleanup Amavisd database
|
||||
1 2 * * * python3 /opt/www/iredadmin/tools/cleanup_amavisd_db.py >/dev/null
|
||||
|
||||
# iRedAdmin: Clean up sql database.
|
||||
1 * * * * python3 /opt/www/iredadmin/tools/cleanup_db.py >/dev/null 2>&1
|
||||
|
||||
# iRedAdmin: Delete mailboxes on file system which belong to removed accounts.
|
||||
1 * * * * python3 /opt/www/iredadmin/tools/delete_mailboxes.py
|
||||
# iRedMail: Cleanup Roundcube SQL database
|
||||
2 2 * * * /usr/bin/php /opt/www/roundcubemail/bin/cleandb.sh >/dev/null
|
||||
|
||||
# iRedMail: Cleanup Roundcube temporary files under 'temp/' directory
|
||||
2 2 * * * /usr/bin/php /opt/www/roundcubemail/bin/gc.sh >/dev/null
|
||||
# iRedMail: Backup SOGo data databases on 04:01AM
|
||||
1 4 * * * /bin/bash /var/vmail/backup/backup_sogo.sh
|
||||
|
||||
# Fail2ban: Unban IP addresses pending for removal (stored in SQL db).
|
||||
* * * * * /bin/bash /usr/local/bin/fail2ban_banned_db unban_db
|
||||
|
||||
0 0 * * * /root/sync-vmail-backup.sh
|
||||
0 6 * * * /root/sync-vmail-backup.sh
|
||||
0 12 * * * /root/sync-vmail-backup.sh
|
||||
0 18 * * * /root/sync-vmail-backup.sh
|
||||
0 2 * * 0 /bin/sh /root/update_certs.sh
|
||||
0 8 * * 2 /bin/sh /root/update_pkgs.sh
|
||||
0 8 * * 5 /bin/sh /root/update_pkgs.sh
|
||||
18
mail.076.ne.jp/sync-vmail-backup.sh
Normal file
18
mail.076.ne.jp/sync-vmail-backup.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
DATE=$(date +"%Y年%m月%d日 %H:%M")
|
||||
|
||||
echo "mail.076.ne.jp メールバックアップ (${DATE})
|
||||
---------------
|
||||
" > /root/backup.txt
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
STATUS="完了"
|
||||
else
|
||||
STATUS="<失敗>"
|
||||
fi
|
||||
|
||||
rsync -vaHz --delete /var/vmail suwako@192.168.10.104:/home/suwako/vmail/mail.076.ne.jp >> /root/backup.txt
|
||||
|
||||
cat /root/backup.txt | mail -s "mail.076.ne.jp メールバックアップ ${STATUS} (${DATE})" -r "server@076.ne.jp" reports@076.ne.jp
|
||||
rm -rf /root/backup.txt
|
||||
16
mail.076.ne.jp/update_certs.sh
Normal file
16
mail.076.ne.jp/update_certs.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
DATE=$(date +"%Y年%m月%d日")
|
||||
|
||||
echo "mail.076.ne.jp SSL証明書が更新されました。 (${DATE})
|
||||
---------------
|
||||
" > /root/cert.txt
|
||||
|
||||
/bin/systemctl stop nginx >> /root/cert.txt
|
||||
/usr/bin/certbot renew >> /root/cert.txt
|
||||
/bin/systemctl start nginx >> /root/cert.txt
|
||||
/bin/systemctl restart postfix >> /root/cert.txt
|
||||
/bin/systemctl restart dovecot >> /root/cert.txt
|
||||
|
||||
cat /root/cert.txt | mail -s "mail.076.ne.jp SSL証明書更新 (${DATE})" -r "server@076.ne.jp" reports@076.ne.jp
|
||||
rm -rf /root/cert.txt
|
||||
15
mail.076.ne.jp/update_pkgs.sh
Normal file
15
mail.076.ne.jp/update_pkgs.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
DATE=$(date +"%Y年%m月%d日")
|
||||
|
||||
echo "mail.076.ne.jp サーバーパッケージが更新されました。 (${DATE})
|
||||
---------------
|
||||
" > /root/apt.txt
|
||||
|
||||
/bin/apt update >> /root/apt.txt
|
||||
/bin/apt upgrade -y >> /root/apt.txt
|
||||
/bin/apt autoremove -y >> /root/apt.txt
|
||||
|
||||
cat /root/apt.txt | mail -s "mail.076.ne.jp パッケージ更新 (${DATE})" -r "server@076.ne.jp" reports@076.ne.jp
|
||||
rm -rf /root/apt.txt
|
||||
Reference in New Issue
Block a user