{"id":2820,"date":"2013-09-03T20:09:18","date_gmt":"2013-09-04T00:09:18","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2013\/09\/03\/email-alert-backup-limit-exceeded\/"},"modified":"2021-10-20T10:12:24","modified_gmt":"2021-10-20T14:12:24","slug":"email-alert-backup-limit-exceeded","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/email\/email-alert-backup-limit-exceeded\/","title":{"rendered":"Send email alert when backup limit exceeded"},"content":{"rendered":"\n<p>If you&#8217;re on a <a href=\"https:\/\/www.inmotionhosting.com\/vps-hosting\" target=\"_blank\" rel=\"noreferrer noopener\">VPS<\/a> or <a rel=\"noopener\" href=\"https:\/\/www.inmotionhosting.com\/dedicated-servers\" target=\"_blank\">dedicated server<\/a> and paying for our <a href=\"https:\/\/www.inmotionhosting.com\/support\/backups-and-restorations\/\" target=\"_blank\" rel=\"noreferrer noopener\">automatic backup service<\/a>, you might like to know when you&#8217;ve gone over the current backup disk-space limit you&#8217;re paying for.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Email alert script<\/h2>\n\n\n\n<p>Below we&#8217;ll create a disk-space monitoring script that can email us when our backup limit is exceeded.<\/p>\n\n\n\n<div style=\"background-color: #fafad2; border: 1px #D3D3D3 dashed; border-radius: 5px; padding: 0px 0px 0px 5px; margin-top: 20px;\">This requires having <a href=\"\/support\/server\/ssh\/root-access-faq\/\" target=\"_blank\" rel=\"noopener\">root access<\/a> to your server already.\n<p>&nbsp;<\/p>\n<\/div>\n\n\n\n<ol class=\"article_list wp-block-list\"><li>Login to your server with <a href=\"\/support\/server\/ssh\/how-to-login-ssh\/\" target=\"_blank\" rel=\"noopener\">SSH<\/a><\/li><li>Run the following commands to create our script:\n<pre class=\"cli\" style=\"width: 330px; margin: 10px;\">touch \/etc\/cron.daily\/backupDiskCheck.cron chmod 755 \/etc\/cron.daily\/backupDiskCheck.cron <\/pre>\n<\/li><li>Now using a text editor like <a href=\"\/support\/server\/ssh\/how-to-edit-files-using-nano\/\" target=\"_blank\" rel=\"noopener\">nano<\/a> create the following script:\n<pre class=\"cli\" style=\"width: 290px; margin: 10px 10px -20px 10px;\">nano \/etc\/cron.daily\/backupDiskCheck.cron<\/pre>\n<p>&nbsp;<\/p>\n<p>Change the <strong style=\"color: red;\">user@example.com<\/strong> address and the <strong style=\"color: red;\">10<\/strong> threshold below:<\/p>\n<pre class=\"cli\">#!\/bin\/bash ADMIN=\"<span style=\"color: red;\">user@example.com<\/span>\" THRESHOLD=<span style=\"color: red;\">10<\/span>  df -h | awk '\/\/$\/ {print $3,$NF}' | while read output;  do   usedDisk=$(echo $output | awk '{print $1}' | sed 's#G##')   partition=$(echo $output | awk '{print $2}')    if [ $usedDisk -ge $THRESHOLD ] &amp;&amp; [ $partition = \"\/\" ]     then     echo \"$(date +%d\/%h\/%Y\" \"%T): Your server $(hostname) is OVER the      $(echo $THRESHOLD)G automatic backup limit, you're using $(echo $usedDisk)G on      the $partition partition.\" | mail -s\"Alert: Over Automatic Backup limit\" $ADMIN   fi done<\/pre>\n<\/li><li>If you were following along and using <strong>nano<\/strong> to edit this file, you can now hit <strong>Ctrl-O<\/strong> to bring up the write file dialog, and then hit <strong>Enter<\/strong> to save your changes.<\/li><\/ol>\n\n\n\n<p>Now once a day your server should check to see if the disk-space usage is over the current level of automatic backups you&#8217;re paying for.<\/p>\n\n\n\n<p>If it does exceed this limit, then you should receive an email at the address you entered with a message like:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted cli\"> 03\/Sep\/2013 16:28:04: Your server vps0123.inmotionhosting.com is currently OVER the 10G automatic backup limit, and is using 28G on the \/ partition.<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re on a VPS or dedicated server and paying for our automatic backup service, you might like to know when you&#8217;ve gone over the current backup disk-space limit you&#8217;re paying for. Email alert script Below we&#8217;ll create a disk-space monitoring script that can email us when our backup limit is exceeded. This requires having<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/email\/email-alert-backup-limit-exceeded\/\"> Read More ><\/a><\/p>\n","protected":false},"author":57014,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4315,4,4288],"tags":[],"class_list":["post-2820","post","type-post","status-publish","format-standard","hentry","category-backup-and-restore","category-email","category-website"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Send email alert when backup limit exceeded | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"If you&#039;re on a VPS or dedicated server and paying for our automatic backup service, you might like to know when you&#039;ve gone over the current backup disk-space limit you&#039;re paying for.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/email\/email-alert-backup-limit-exceeded\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Send email alert when backup limit exceeded | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"If you&#039;re on a VPS or dedicated server and paying for our automatic backup service, you might like to know when you&#039;ve gone over the current backup disk-space limit you&#039;re paying for.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/email\/email-alert-backup-limit-exceeded\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2013-09-04T00:09:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-10-20T14:12:24+00:00\" \/>\n<meta name=\"author\" content=\"InMotion Hosting Contributor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InMotion Hosting Contributor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/email\/email-alert-backup-limit-exceeded\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/email\/email-alert-backup-limit-exceeded\/\"},\"author\":{\"name\":\"InMotion Hosting Contributor\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644\"},\"headline\":\"Send email alert when backup limit exceeded\",\"datePublished\":\"2013-09-04T00:09:18+00:00\",\"dateModified\":\"2021-10-20T14:12:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/email\/email-alert-backup-limit-exceeded\/\"},\"wordCount\":188,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"Backups and Restorations\",\"Email\",\"Website\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/email\/email-alert-backup-limit-exceeded\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/email\/email-alert-backup-limit-exceeded\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/email\/email-alert-backup-limit-exceeded\/\",\"name\":\"Send email alert when backup limit exceeded | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2013-09-04T00:09:18+00:00\",\"dateModified\":\"2021-10-20T14:12:24+00:00\",\"description\":\"If you're on a VPS or dedicated server and paying for our automatic backup service, you might like to know when you've gone over the current backup disk-space limit you're paying for.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/email\/email-alert-backup-limit-exceeded\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/email\/email-alert-backup-limit-exceeded\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/email\/email-alert-backup-limit-exceeded\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Send email alert when backup limit exceeded\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644\",\"name\":\"InMotion Hosting Contributor\",\"description\":\"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!\",\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/inmotion-hosting\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting\"],\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/inmotion-hosting-contributor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Send email alert when backup limit exceeded | InMotion Hosting","description":"If you're on a VPS or dedicated server and paying for our automatic backup service, you might like to know when you've gone over the current backup disk-space limit you're paying for.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.inmotionhosting.com\/support\/email\/email-alert-backup-limit-exceeded\/","og_locale":"en_US","og_type":"article","og_title":"Send email alert when backup limit exceeded | InMotion Hosting","og_description":"If you're on a VPS or dedicated server and paying for our automatic backup service, you might like to know when you've gone over the current backup disk-space limit you're paying for.","og_url":"https:\/\/www.inmotionhosting.com\/support\/email\/email-alert-backup-limit-exceeded\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2013-09-04T00:09:18+00:00","article_modified_time":"2021-10-20T14:12:24+00:00","author":"InMotion Hosting Contributor","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"InMotion Hosting Contributor","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/email\/email-alert-backup-limit-exceeded\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/email\/email-alert-backup-limit-exceeded\/"},"author":{"name":"InMotion Hosting Contributor","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644"},"headline":"Send email alert when backup limit exceeded","datePublished":"2013-09-04T00:09:18+00:00","dateModified":"2021-10-20T14:12:24+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/email\/email-alert-backup-limit-exceeded\/"},"wordCount":188,"commentCount":0,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["Backups and Restorations","Email","Website"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/email\/email-alert-backup-limit-exceeded\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/email\/email-alert-backup-limit-exceeded\/","url":"https:\/\/www.inmotionhosting.com\/support\/email\/email-alert-backup-limit-exceeded\/","name":"Send email alert when backup limit exceeded | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2013-09-04T00:09:18+00:00","dateModified":"2021-10-20T14:12:24+00:00","description":"If you're on a VPS or dedicated server and paying for our automatic backup service, you might like to know when you've gone over the current backup disk-space limit you're paying for.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/email\/email-alert-backup-limit-exceeded\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/email\/email-alert-backup-limit-exceeded\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/email\/email-alert-backup-limit-exceeded\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"Send email alert when backup limit exceeded"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644","name":"InMotion Hosting Contributor","description":"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!","sameAs":["https:\/\/www.linkedin.com\/company\/inmotion-hosting\/","https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting"],"url":"https:\/\/www.inmotionhosting.com\/support\/author\/inmotion-hosting-contributor\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":null,"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2820","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/57014"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=2820"}],"version-history":[{"count":5,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2820\/revisions"}],"predecessor-version":[{"id":90028,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2820\/revisions\/90028"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=2820"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=2820"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=2820"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}