Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional post backup status partial #1001

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

eugenefvdm
Copy link

This is a proposal set set an additional environment variable to indicate if a backup was a partial success as opposed to a hard success or fail. We are using centralised software to keep track of all backups and it would be useful for our operators to know when backups were partial.

  • My IDE has small tab/spacing issues that I couldn't correct easily
  • In theory we would have 0 for fail, 1 for success, and 2 for partial and avoid have duplicate environment variables so perhaps there is some redundancy that the team wants to consider.

@jcameron
Copy link
Collaborator

Thanks for this PR! But wouldn't this change the BACKUP_STATUS environment variable from a number (0 or 1) to a string (ok, failed, partial) ?

@eugenefvdm
Copy link
Author

The new string status is set in backup.pl because that's the place where one determines if it's partial.

Then set_backup_envs in backup-libs.pl is called with the string value, where a new environment variable is set

$ENV{'BACKUP_STATUS_CODE'} = $status eq 'ok' ? 1 :
                                $status eq 'partial' ? 2 : 0;

Ideally I would have liked just BACKUP_STATUS instead of a new value.

I might have done something wrong because I don't know the code well enough.

I'll see if I can test this, but I'm not sure how to make a backup fail partially but will try to kill the network during backup.

@jcameron
Copy link
Collaborator

So it looks like in the old code, BACKUP_STATUS was set to either 0 or 1 , and BACKUP_STATUS_CODE was not set at all.

Unfortunately the comment on set_backup_envs makes it seem like the status parameter is either "ok" or "failed", when actually it's just a number : https://github.com/virtualmin/virtualmin-gpl/blob/master/backups-lib.pl#L6940

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants