Unsolved

This post is more than 5 years old

1530

December 27th, 2017 08:00

Using mccli to discover where a file is, within Avamar

Disclaimer:  I'm NOT an Avamar administrator, so assume I know very little (in case that's not obvious). 

I'm actually a DBA, and we have process of performing periodic restores of database backups (DB2) from Avamar to disk to confirm their viability.  This is currently a very hands-on process involving both an Avamar admin (AA) and a DBA for each database backup we need to restore (and there are 40+ different databases across 40+ nodes).   In an effort to free-up time for the DBA and AA I'm trying to write a ksh script to automate the process.

I'm planning on having it file-driven with a file layout of:

     node-name   database-name   backup-directory

     eg:  NODE123   DB_ABC   /topdir/subdir1/subdir2

So the DB2 backup of database DB_ABC is in directory /topdir/subdir1/subdir2 on NODE123 .

The daily Avamar task that performs the backup of that database backup may not specify the full directory spec if it's also backing up other files, so it might only have /topdir or /topdir/subdir1 specified in its task definition.

So, given that file layout, what mccli commands would I need to run to uncover where the most recent Avamar backup of the DB2 backup file is?  Our AA's use the Avamar GUI to manage Avamar, so they're not mccli experts.

So far I've come up with this approach.

     Get list of groups that this node is a member of (mccli client show)

     For each group

          Get the dataset (mccli group show)

          For each dataset, get the filesytems (mccli dataset show)

               If "AIX File System Target" matches some part of the backup-dir from my file (with no excludes of the backup directory)

                    Restore the latest dataset backup to a standalone node

                    Exit

               End-If

          End-For

     End-For

Is there a more direct route to find the latest backup of a database?  Is there some way to search the most recent Avamar backups, for a given node, for a specific wild-card filename (eg: DB_ABC*.001)?

Any guidance would be appreciated.

Thanks.

Richard

December 27th, 2017 13:00

Or perhaps this way.

    Get list of backups for this node (mccli backup show --name=/this-node --after=last-two-weeks)

    For each label #

          Check the backup for file in the directory of interest

               (mccli backup show --name=this-node --after=last-two-weeks  --labelNum=label# --dir=/directory-of-interest)

          if files are found, look for the most recent DB2 backup file

          if backup found, restore it

               mccli backup restore --name= -labelNum= -data=full-path-to-file

               exit

          End-If

    End-For

No Events found!

Top