Setting email alert when backup limit exceeds

If you have hosted your web site on a VPS or a dedicated server, you would possibly like to get an update if this current backup disk-space limit exceeds.

So here is a step by step method to create a disk-space monitoring script that may send you an email if the backup limit exceeds.

To your server, you must be already having root access.

Step: 1. Login to your server with SSH

Step: 2. Run the following commands to create a script:

touch /etc/cron.daily/backupDiskCheck.cron
chmod 755 /etc/cron.daily/backupDiskCheck.cron

Step: 3. Now by using a text editor like nano create the following script:

Change the [email protected] address and the 10 threshold below:

Step: 4. If you were following along and using nano to edit this file, you can now press Ctrl-O to bring up the write file dialog, and then press Enter to save the changes.

Now once a day your server will check to see if the disk-space usage is over the current level of automatic backups or not.

If the limit exceeds, you will receive an email at the email address you entered in the script.