{"id":2266,"date":"2017-12-08T06:06:04","date_gmt":"2017-12-08T06:06:04","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=2266"},"modified":"2020-01-09T09:46:16","modified_gmt":"2020-01-09T09:46:16","slug":"crontab-condition-if-a-file-size-is-more-than-5000k-than-send-an-email","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/crontab-condition-if-a-file-size-is-more-than-5000k-than-send-an-email\/","title":{"rendered":"Crontab condition, if a file size is more than 5000K than send an email"},"content":{"rendered":"<p><strong>scmuser created the topic: crontab condition, if a file size is more than 5000K than send an email<\/strong><\/p>\n<p>find \/var\/www\/vhosts\/domain\/folder\/ -name &#8216;*.flv&#8217; -size +5000k | grep flv &#038;&#038; \/bin\/mail -s &#8220;The file is available!&#8221; &#8220;my@address.com&#8221; > \/dev\/null<\/p>\n<p>If grep detects a line containing the string flv in the output of find it returns 0, otherwise 1. The mail command will only be executed on exit code 0 of grep.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>scmuser created the topic: crontab condition, if a file size is more than 5000K than send an email find \/var\/www\/vhosts\/domain\/folder\/ -name &#8216;*.flv&#8217; -size +5000k | grep flv &#038;&#038; \/bin\/mail -s&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[454],"tags":[473],"class_list":["post-2266","post","type-post","status-publish","format-standard","hentry","category-shell-script","tag-email"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2266","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=2266"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2266\/revisions"}],"predecessor-version":[{"id":2267,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2266\/revisions\/2267"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=2266"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=2266"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=2266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}