{"id":8238,"date":"2015-07-27T11:37:23","date_gmt":"2015-07-27T15:37:23","guid":{"rendered":"http:\/\/www.ezrasf.com\/wplog\/?p=8238"},"modified":"2015-07-27T11:37:23","modified_gmt":"2015-07-27T15:37:23","slug":"check-backups","status":"publish","type":"post","link":"https:\/\/www.ezrasf.com\/wplog\/2015\/07\/27\/check-backups\/","title":{"rendered":"Check Backups"},"content":{"rendered":"<p>I get a daily report about backups for each of the projects. One particular one has shown some odd results. The report has columns for:\u00c2\u00a0Completed, Successful, Partial, Failed, Missed, and Active. The particular problem is that backups\u00c2\u00a0show up in none of those columns when it is actually still actively running. (So it should show up as active?)<\/p>\n<p>So I wrote the other day a Bash script to check\u00c2\u00a0some\u00c2\u00a0things. In the future I can quickly assess if this is the SNAFU (Situation Normal All F***ed Up) or something else. Really, the other day I had to track back into my history this information to do it manually, which is stupid.<\/p>\n<blockquote><p>#!\/bin\/bash<br \/>\n###########################################################<br \/>\n# Check backup status.<br \/>\n# 2015-JUL-24 Ezra Freelove,\u00c2\u00a0email@domain.com<br \/>\n###########################################################<br \/>\n# Look for running processes<br \/>\necho &#8220;&#8230; Backup processes&#8221;<br \/>\nps -ef | grep [p]rocname<br \/>\n# Report logs<br \/>\necho &#8220;&#8230; Logs&#8221;<br \/>\nls -ltr \/path\/to\/agent.log \/session\/path\/to\/clientlogs\/*.log<br \/>\necho &#8220;==========&#8221;<br \/>\n# Specific lines excluding spam and blank<br \/>\ntail -100 \/path\/to\/agent.log | grep -vf \/home\/me\/myscripts\/backups\/exclude\/ckrunning.txt | grep -v &#8220;^ $&#8221;<\/p><\/blockquote>\n<p>If the backup is still running, then the ps will show the PID and time started.<\/p>\n<p>In addition the logs are reported with the most recently changed at the end.<\/p>\n<p>The agent talks to a central service to find out when it should be doing stuff. The exclude\/ckrunning.txt file uses\u00c2\u00a0the below entries to ignore spammy lines where the agent is checking but not told to do anything. This ignores\u00c2\u00a0about 70 of the 100 lines when everything is normally operating from my check.<\/p>\n<ul>\n<li>Sleeping<\/li>\n<li>Workorder received: sleep<\/li>\n<li>Requesting work<\/li>\n<\/ul>\n<p>Long-term, I guess I should ask why the long-running backup does not appear in the Active category when it obviously should.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I get a daily report about backups for each of the projects. One particular one has shown some odd results. The report has columns for:\u00c2\u00a0Completed, Successful, Partial, Failed, Missed, and Active. The particular problem is that backups\u00c2\u00a0show up in none of those columns when it is actually still actively running. (So it should show up [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3011],"tags":[324,3012],"class_list":["post-8238","post","type-post","status-publish","format-standard","hentry","category-scripting","tag-bash","tag-script"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p1rUBW-28S","jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ezrasf.com\/wplog\/wp-json\/wp\/v2\/posts\/8238","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ezrasf.com\/wplog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ezrasf.com\/wplog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ezrasf.com\/wplog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ezrasf.com\/wplog\/wp-json\/wp\/v2\/comments?post=8238"}],"version-history":[{"count":0,"href":"https:\/\/www.ezrasf.com\/wplog\/wp-json\/wp\/v2\/posts\/8238\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ezrasf.com\/wplog\/wp-json\/wp\/v2\/media?parent=8238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ezrasf.com\/wplog\/wp-json\/wp\/v2\/categories?post=8238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ezrasf.com\/wplog\/wp-json\/wp\/v2\/tags?post=8238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}