Announcement Banner
UNSOLVED

cmartinjr

updated

12 years ago

C

cmartinjr

40 Posts

0

841

October 2nd, 2014 06:00

Oldest backup??

Hello,

I've been tasked with pulling the oldest backup info for our clients.  Problem is I have over 2000 clients and I have some clients that I started backing up in 2009, some in 2010, and so on.  Other than pulling a mminfo -q CLIENTNAME is there a more efficient way to find the oldest backup for a client?  I don't want to delete the oldest backup, I just want to find it.

Thanks in advance..

  • ble1

    6 Operator

    •

    14354 Posts

    •

    56186 Points

    532

    0

    Posted October 2nd, 2014 06:00

    List of clients (unless someome removed index folder) is in /nsr/index... so what you can do is

    for client in `ls -1 /nsr/index`; do mminfo -avot -q client=$client -r 'name,savetime(20),level,group,pool,volume' | head -30 >> /tmp/foo;done

    Above I limited output per client to first 30 lines so feel free to adjust it anyway you like.

  • bingo.1

    1 Rookie

    •

    2430 Posts

    532

    0

    Posted October 2nd, 2014 07:00

    Another method could be to find backups by savetime - for example:

      mminfo -q "savetime<01/01/2010" -r "client,name,level,savetime,ssid,volume" -ocn [> file]

  • cmartinjr

    40 Posts

    532

    0

    Posted October 2nd, 2014 07:00

    Thanks for the quick replies,

    Bingo - I had thought about that, but the only thing is that I have clients that I setup as late as a few days ago and as early as 2009.  So I would have to expand my query to be something like ......"savetime<10/2/2014".....  I didn't know what type of hit that would give the database to pull all of that data for all of those clients while backups, cloning, and restores are running..  Thank you.

    Hrvoje - I'm trying that command now, and it's giving me back info.  I didn't think about running the "head" command against my output to limit what it gives back.  One thing that I did add to it was client to the output that it gives. Thank you.

    I guess my main concern is if there was a way to only pull the oldest backup without querying for any other backup data.  Something like:

    mminfo -q "oldest backup only" -c CLIENTNAME

    Thanks for the info

  • bingo.1

    1 Rookie

    •

    2430 Posts

    532

    0

    Posted October 2nd, 2014 08:00

    As mentioned - the above command was just an example.

    BTW - you can also specify a range by using 2 queries - for example:

      mminfo -q "savetime>01/01/2010,savetime<01/01/2011" -r "client,name,level,savetime,ssid,volume" -ocn [> file]

    The impact of the media db is usually small. However, this depends of course on your machine specs.

  • cmartinjr

    40 Posts

    532

    0

    Posted October 2nd, 2014 12:00

    Cool, I didn't know you could do a range.  I have the query running now, it's taking a long time for it to finish, but nothing's gone down yet so I'll let it continue..