Check Backups

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: Completed, Successful, Partial, Failed, Missed, and Active. The particular problem is that backups show up in none of those columns when it is actually still actively running. (So it should show up as active?)

So I wrote the other day a Bash script to check some things. 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.

#!/bin/bash
###########################################################
# Check backup status.
# 2015-JUL-24 Ezra Freelove, email@domain.com
###########################################################
# Look for running processes
echo “… Backup processes”
ps -ef | grep [p]rocname
# Report logs
echo “… Logs”
ls -ltr /path/to/agent.log /session/path/to/clientlogs/*.log
echo “==========”
# Specific lines excluding spam and blank
tail -100 /path/to/agent.log | grep -vf /home/me/myscripts/backups/exclude/ckrunning.txt | grep -v “^ $”

If the backup is still running, then the ps will show the PID and time started.

In addition the logs are reported with the most recently changed at the end.

The agent talks to a central service to find out when it should be doing stuff. The exclude/ckrunning.txt file uses the below entries to ignore spammy lines where the agent is checking but not told to do anything. This ignores about 70 of the 100 lines when everything is normally operating from my check.

  • Sleeping
  • Workorder received: sleep
  • Requesting work

Long-term, I guess I should ask why the long-running backup does not appear in the Active category when it obviously should.

The post Check Backups appeared first on Rants, Raves, and Rhetoric v4.

From Check Backups published July 27, 2015 at 11:37AM.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s