Simple yet effective backup script for migrating mailboxes - breakerh/imap-backup-dovecot
Imapsync is an IMAP transfers tool. The purpose of imapsync is to migrate IMAP accounts or to backup IMAP accounts. IMAP is one of the three current standard protocols to access mailboxes, the two ...
# apt install nagios-plugins-common nagios-plugins-basic
#!/bin/sh
NAGIOS=/usr/lib/nagios/plugins
#SERVER_name will be used as a prefix for the filenames
SERVER_NAME="katerina"
ROOT_WEB=/home/katerina/public_html/status
# If free disk space under 25%, warning, if under 10% critical
$NAGIOS/check_disk -w 25% -c 10% > $ROOT_WEB/$SERVER_NAME-disk
# If load > 3 (1 minute), 2 (5 minutes), 1 (15 minutes), warning, if load > 6 (1'), 4 (5'), 2 (15'), critical
$NAGIOS/check_load -w 3,2,1 -c 6,4,2 > $ROOT_WEB/$SERVER_NAME-load
# If mysql process doesn't exist, critical
$NAGIOS/check_procs -c 1:1 -C mysqld > $ROOT_WEB/$SERVER_NAME-mysql
# If apache process doesn't exit or above 35 processes, critical
$NAGIOS/check_procs -w 1:25 -c 1:35 -C apache2 > $ROOT_WEB/$SERVER_NAME-apache
# If nginx process doesn't exit or above 35 processes, critical
$NAGIOS/check_procs -w 1:25 -c 1:35 -C nginx > $ROOT_WEB/$SERVER_NAME-nginx
chmod +x /opt/server-status
*/3 * * * * /opt/server-status > /dev/null 2>> /var/log/server-status.log # Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]In this article, we'll go over how you can use SSH to mitigate the risk of data lose that comes from using the same private key for all the servers you manage.
cd /var/vmail/vmail1/example.com/p/a/u/username-2005.09.20.12.30.07/Maildir
find . -type f | grep -E ',[^,]*S[^,]*$' # finds all readed
find . -type f | grep -vE ',[^,]*S[^,]*$' # find all unreaded
find . -type f | grep -vE ',[^,]*S[^,]*$' | wc -l # count them
find . -type f | grep -vE ',[^,]*S[^,]*$' | xargs rm # remove themOver at Mahana Designs we usually work with stateless session (meaning that there are no server sessions but instead the user information…