UNSOLVED

colchesterCI

updated

15 years ago

0

1230

September 7th, 2011 05:00

Automate Restore

Hi there

I've found a couple of posts on here regarding this subject but niether were of any real help to me.

What i wish to do is have a script that i can schedule that would kick off a restore for me of the last back of a server.  I want to restore to a different server than where the data originally come from.

So in my head it would work like this:

Server A gets backed up as per normal >>>>>> Scheduled script then runs to Restore Data from the Last back up of Server A to Server B

So is this possible also what would be the commands to use? I'm guessing using Scheduled Tasks is fine and I'm assuming it would be a batch file that would kickoff the MCCLI with the various commands, but thats where i'm stuck as i have no idea what these commands would be or how to start the MCCLI from a Bat.

Many thanks

  • 288

    0

    Posted September 8th, 2011 03:00

    Hi Armitage,

    In case you need to do an automated restore you require the last backup  Label Number. so in your case you need to find the last backup label of client ServerA

    here is the command to find the last backup label number of client ServerA

    mccli backup show --name=/clients/ServerA |awk 'NR==4 { print $4 }'

    To redirect a restore of a  specific backup label you need to run

    mccli backup restore --name=/clients/ServerA --plugin=3001 --labelNum=1 --dest-client-name=/clients/ServerB --dest-dir=/xyz/abc

    Once you knowhow to restore using the last backup label, you can now perfrom the restore using the below commad, in order to have this automated have this addded to the crontab for automation of the restores

    mccli backup restore --name=/clients/ServerA --plugin=3001 --labelNum=`mccli backup show --name=/clients/dc.example.local |awk 'NR==4 { print $4 }'` --dest-client-name=/clients/ServerB --dest-dir=/xyz/abc

    --name = Client's backup to be restored

    --dest-client-name= Alternative client used to perform re-directed restore

    --dest-dir=String = Optional destination directory to restore to

    Thanks

    Rudresh

  • 288

    0

    Posted September 13th, 2011 02:00

    excuse my stupidity, not long had avamar in but wheres the cron tab etc

    Many thanks

  • rpervan

    266 Posts

    288

    0

    Posted September 13th, 2011 02:00

    hi Armitrage,

    # su - admin

    # crontab -l

    .r