Standalone backup agents for Linux, Mac, AIX & Solaris workloads on-premises or in the public cloud
Post Reply
ober72
Veeam Vanguard
Posts: 698
Liked: 136 times
Joined: Jan 24, 2014 4:10 pm
Full Name: Geoff Burke
Contact:

Automated Restore

Post by ober72 »

Hi Folks,

Has anybody setup an automated daily restore (script). I want to have a folder containing certain files to be restored every day to another test Linux server that I have. So the idea would be nightly automated file level backup direct to cloud connect of the folder on one server. Then the next morning automated restore from cloud connect to there other server.

cheers
Geoff Burke
VMCA2022, VMCE2023, CKA, CKAD
Veeam Vanguard, Veeam Legend
nielsengelen
Product Manager
Posts: 5619
Liked: 1177 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Automated Restore

Post by nielsengelen »

I’m sure this can be scripted via bash by leveraging veeamconfig. Quickly thinking about it the workflow would be:
- list/get latest restore point
- mount it to a folder
- perform the copy to the original folder / other server (use rsync/scp)
- unmount the backup
- optional: send a mail?

Put this in a crontab and you should be good to go.
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
ober72
Veeam Vanguard
Posts: 698
Liked: 136 times
Joined: Jan 24, 2014 4:10 pm
Full Name: Geoff Burke
Contact:

Re: Automated Restore

Post by ober72 »

Thanks Niels

That was very helpful. I will give it a try and send feedback if I see anything interesting.

The stuff you can do with Veeam!!! :)

cheers
Geoff Burke
VMCA2022, VMCE2023, CKA, CKAD
Veeam Vanguard, Veeam Legend
ober72
Veeam Vanguard
Posts: 698
Liked: 136 times
Joined: Jan 24, 2014 4:10 pm
Full Name: Geoff Burke
Contact:

Re: Automated Restore

Post by ober72 »

Hi Niels,

I am working on this but am stuck. Is there a way use veeamconfig to simply restore the latest available backup on a new server? Or is there a way to query the backup id in order to then pipe into a restore command?
I might have this wrong but it seems that to do a restore in a script or command line using veeamconfig you have to know the backup id but I could not find any way of getting that apart from running veeam (i.e. going through the UI) to list the ID's?

cheers
Geoff Burke
VMCA2022, VMCE2023, CKA, CKAD
Veeam Vanguard, Veeam Legend
PTide
Product Manager
Posts: 6408
Liked: 724 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Automated Restore

Post by PTide »

Right, to restore disks to the most recent state you need to use

Code: Select all

veeamconfig backup restore --id <value> --targetDev <value> --backupDev <value>
If you just want to mount the backup in order to work with the files use

Code: Select all

veeamconfig backup mount --id <value> --mountDir <value>
To get backup ids you should use

Code: Select all

veeamconfig backup list
It will give you something similar to this:

Code: Select all

node1 FLB3_folder_imported   {e7e9acd2-6940-438a-8d74-cfe59290f38c}                                          2019-05-20 20:31
node1 FLB3_test              {9b01faed-1a67-4a45-b201-89b28a8f2e86}   Repository_1                           2019-05-20 20:28
node1 FLB3_PoC               {1fcab1f5-44a0-4fb9-b4d1-c82b55836cda}   [Win2016] ReFS 2019-05-20              2019-05-20 20:39
After that you awk/sed/grep things out of it and pipe them to the script.

Thanks!
ober72
Veeam Vanguard
Posts: 698
Liked: 136 times
Joined: Jan 24, 2014 4:10 pm
Full Name: Geoff Burke
Contact:

Re: Automated Restore

Post by ober72 »

Hi PTyde,

I tried those but it does not show anything. This is on the other server. My setup is that I want to test setting up automatic restores on the "DR" Server. In case the original server is no longer available we can always use the UI of course to get the backup ID's but I was trying to automate this a bit.
When I run veeamconfig backup list on the new server it does not show any backups, even though I have just gone into the UI and seen them.

cheers
Geoff Burke
VMCA2022, VMCE2023, CKA, CKAD
Veeam Vanguard, Veeam Legend
PTide
Product Manager
Posts: 6408
Liked: 724 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Automated Restore

Post by PTide »

Did you add the "DR" server and performed rescan of the repos after that?

Code: Select all

veeamconfig vbrserver add --name <name> --address <address> --login

Code: Select all

veeamconfig repository rescan --all
Thanks!
ober72
Veeam Vanguard
Posts: 698
Liked: 136 times
Joined: Jan 24, 2014 4:10 pm
Full Name: Geoff Burke
Contact:

Re: Automated Restore

Post by ober72 »

Hi P.Tide,

This is a linux agent direct to cloud and a linux agent retrieving direct from the cloud. I added the service provider.

So no local vbr server is present.

cheers
Geoff Burke
VMCA2022, VMCE2023, CKA, CKAD
Veeam Vanguard, Veeam Legend
ober72
Veeam Vanguard
Posts: 698
Liked: 136 times
Joined: Jan 24, 2014 4:10 pm
Full Name: Geoff Burke
Contact:

Re: Automated Restore

Post by ober72 »

Hi Folks,

I have put in a case about this since I can't figure this out Case # 03609534

Will update once done.

cheers
Geoff Burke
VMCA2022, VMCE2023, CKA, CKAD
Veeam Vanguard, Veeam Legend
ober72
Veeam Vanguard
Posts: 698
Liked: 136 times
Joined: Jan 24, 2014 4:10 pm
Full Name: Geoff Burke
Contact:

Re: Automated Restore

Post by ober72 »

Support is saying that you need to import the vbm from the other machine but what if this is a disaster and the other machine is no longer. I will make this a feature request, i.e. the ability to import the backups from the cloud using veeamconfig in order to automate restore.

cheers
Geoff Burke
VMCA2022, VMCE2023, CKA, CKAD
Veeam Vanguard, Veeam Legend
PTide
Product Manager
Posts: 6408
Liked: 724 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Automated Restore

Post by PTide »

Ok, makes sense. We'll add a more straightforward way of importing backups into VAL via CLI.

Thank you!

P.S. You can also do the following

Code: Select all

veeamconfig cloud add --address <IP> --login <tenant>
<at this point it will prompt you for tenant's password>
veeamconfig cloud resync
veeamconfig backup mount --id <backup id>
That's for FLR. A similar approach can be used for device restore as well (veeamconfig backup restore --id <backup id> --targetDev <enum> --backupDev <enum>).

Please note, that although cloud repo will show up after you add cloud server, backup list won't show you backups stored in CC. That is, you have to know backup id from other sources (e.g. the other machine)
ober72
Veeam Vanguard
Posts: 698
Liked: 136 times
Joined: Jan 24, 2014 4:10 pm
Full Name: Geoff Burke
Contact:

Re: Automated Restore

Post by ober72 »

Hi Ptide,

Ok thanks I will give that a try. In fact right now I need to restore a folder so that should work.

cheers
Geoff Burke
VMCA2022, VMCE2023, CKA, CKAD
Veeam Vanguard, Veeam Legend
PTide
Product Manager
Posts: 6408
Liked: 724 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Automated Restore

Post by PTide »

So, how is it going? Btw, is the other server operating in a standalone mode, or in managed mode?

Thanks!
ober72
Veeam Vanguard
Posts: 698
Liked: 136 times
Joined: Jan 24, 2014 4:10 pm
Full Name: Geoff Burke
Contact:

Re: Automated Restore

Post by ober72 »

Hi P.Tide,

It is in standalone mode. Right now got busy with some S3 stuff for tiering but will be going back to this project soon. My thought was to have a script grab the vbm from the cloud repository and download to the local new server, then import that so that the backup id's are present then restore. If I have these in managedmode maybe this will be easier?

cheers
Geoff Burke
VMCA2022, VMCE2023, CKA, CKAD
Veeam Vanguard, Veeam Legend
ober72
Veeam Vanguard
Posts: 698
Liked: 136 times
Joined: Jan 24, 2014 4:10 pm
Full Name: Geoff Burke
Contact:

Re: Automated Restore

Post by ober72 »

Also forgot to mention this is for a cloud direct linux agent. I don't believe you can manage a linux agent from the VAC.

cheers
Geoff Burke
VMCA2022, VMCE2023, CKA, CKAD
Veeam Vanguard, Veeam Legend
PTide
Product Manager
Posts: 6408
Liked: 724 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Automated Restore

Post by PTide »

I don't believe you can manage a linux agent from the VAC.
Right, that feature is not available yet.
If I have these in managed mode maybe this will be easier?
Not really, since managed mode does not allow users to perform restores in CLI.

Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests