2015-12-06 16:28:04 +10:00
Scripts for different tasks
===========================
These scripts perform multiple of different tasks that help monitor the server and send emails after performing functions.
To send emails the sendEmail package is required
2018-07-05 11:58:24 +10:00
< pre >
apt-get install sendemail
< / pre >
2015-12-06 16:28:04 +10:00
Change the following lines in scripts that send emails
2016-03-28 18:55:16 +10:00
MAILFROM is set to determine the server name and domain name for the server and generate and email for it to determine where the email is coming from. This can be changed to specify an email address or you can leave it to generate one.
2018-07-05 11:58:24 +10:00
< pre > MAILTO=user@example.com
2016-03-28 18:55:16 +10:00
SMTP=mail.example.com
MAILFROM=$(hostaname)@$(dnsdomainname)
2018-07-05 11:58:24 +10:00
< / pre >
2015-12-06 16:28:04 +10:00
#### 00logwatch
This script sends a report based on the log files and settings.
< b > Installation< / b >
2018-07-05 11:58:24 +10:00
< pre > apt-get install logwatch
2015-12-06 16:28:04 +10:00
ln -s $(pwd)/00logwatch /etc/cron.daily
2018-07-05 11:58:24 +10:00
< / pre >
2015-12-06 16:28:04 +10:00
2018-07-05 11:58:24 +10:00
#### check_updates_deb
2015-12-06 16:28:04 +10:00
2016-03-28 18:55:16 +10:00
This script checks for updates on your Debian based systems. If any updates are found it will download them ready for Installation and an email will be sent to an email address specified
2015-12-06 16:28:04 +10:00
< b > Installation< / b >
2018-07-05 11:58:24 +10:00
< pre > ln -s $(pwd)/check_updates_deb /etc/cron.daily
< / pre >
#### dbbackup
2015-12-06 16:28:04 +10:00
This scripts backs up mysql databases and rotates the number of backups through seven days.
Specify the user and password that has access to the databases.
2018-07-05 11:58:24 +10:00
< pre > DBUSER='dbbackup'
2015-12-06 16:28:04 +10:00
DBPASS='EWFfP3GZsqr427Yj'
BACKUPDIR='/BACKUP/db/'
2018-07-05 11:58:24 +10:00
< / pre >
2015-12-06 16:28:04 +10:00
< b > Installation< / b >
2018-07-05 11:58:24 +10:00
< pre > ln -s $(pwd)/dbbackup /etc/cron.daily
< / pre >
2015-12-06 16:28:04 +10:00
2018-07-05 11:58:24 +10:00
#### diskalert
2015-12-06 16:28:04 +10:00
2018-07-05 11:58:24 +10:00
Sends and email when disk space reaches greater than 90%.
2015-12-06 16:28:04 +10:00
< b > Installation< / b >
2018-07-05 11:58:24 +10:00
< pre > ln -s ${pwd}/diskalert.sh /etc/cron.hourly
2024-06-21 21:51:57 +10:00
< / pre >