bseltz-cohesity / scripts

Cohesity REST API examples in PowerShell and Python
Apache License 2.0
103 stars 41 forks source link

backupNow adherence to policy #94

Closed nwageler closed 1 year ago

nwageler commented 1 year ago

We are testing implementation of backupNow to initiate runs for a protection group that is set to paused (to be run on-demand only).

The policy includes Daily local backup, Daily replication and Monthly cloud archive: policy

However running backupNow daily (without any copy retention parameters) always triggers a cloud archive which should only be running Monthly according to the policy: runs

Command syntax used:

./backupNow.ps1 -vip mycluster `
                -username myusername `
                -domain mydomain.net `
                -jobName 'My Job'

We are not able to make use of the optional copy retention parameters in this case.

Is it possible to have backupNow strictly adhere to the frequency and retention specified in the protection group's policy?

bseltz-cohesity commented 1 year ago

I understand the request, but backupNow is designed to be analogous to the run now dialog in the Cohesity UI, which also does not respect the frequency of the remote targets. The reason being that it would be highly complex to calculate whether we need an archive during this run of the script or not, and that would likely lead to unexpected behavior. Instead you can use the -noArchive command line switch to stop it from archiving, and on the day of the month you wish to archive, you can omit that switch. Hope that helps!

nwageler commented 1 year ago

Makes sense, thank you!