cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

Command to list the status of a job from a client

Hi, everybody

I am using the /usr/openv/netbackup/bin/bpbackup to perform a User Backup and I have to remove the files that were backuped successfully. What command should I fire from my client to list this backup status (example 0 - succesfull, 1 - partial , 96 - unable to allocate new media)?

There aren´t bperror and bpdbjobs on client install.

My client is a Oracle Linux 7.8, Netbackup client version 7.7.3.

Thanks

Tags (2)
1 Solution

Accepted Solutions
Accepted Solution!

Re: Command to list the status of a job from a client

hi @andrich2016 

Use the -w parameter if you need to check status of the bpbackup command.

When using the -w qualifier,  bpbackup wont return to the command prompt, but wait until the backup job is complete, and bpbackup exit code will be the status of the backup.

I have used the same trick many time before to ensure a client initiated backup is OK.

Exit code from a command in Linux/UNIX is stored in the variable $? and return value shoudl be check as first command after the bpbackup command. 

Pls See: https://www.cyberciti.biz/faq/bash-get-exit-code-of-command/

View solution in original post

5 Replies
Highlighted

Re: Command to list the status of a job from a client

I'm unsure what you're asking about. Are you running bpbackup and the backup is failing? If so, what error code?

Are you running bpbackup and it completes successfully but the files aren't being deleted after a successful backup? That would be because you should be using bparchive to achieve that result.

Highlighted

Re: Command to list the status of a job from a client

Should I ran the command line this way and read the exit.txt file to check the result. If its empty, the backup was fine.

I woul like a command that I fire from the client tha ran the job to check if the backup has finished fine. Is there this command?

/usr/openv/netbackup/bin/bpbackup -p $POLITICA -s $SCHEDULE -w 0 -f $DIRETORIOS &> exit.txt
bash-3.2$ more exit.txt
EXIT STATUS 96: unable to allocate new media for backup, storage unit has none available

Tags (2)
Highlighted

Re: Command to list the status of a job from a client

First off a quick opinion : It's called NetBackup, not NetDelete; if end users want files deleted after a backup, make them do it. =) Use bplist to provide a complete list of all files you've backed up for them (or better yet, train them how to run the command at their convenience) and if they then choose to delete some/all of those files for whatever reason, that's their call as the owners. If YOU delete the files however, suddenly you're putting yourself on the hook for a classic "oops I removed the wrong critical production file" moment and managers start asking pointed questions. Second, if for whatever reason you're stuck with this responsibility anyway...you probably want the bparchive command, not bpbackup. Clients have very limited binary/library set and it does not include any direct commands to check backup statuses - bplist is probably as far as you could get with that anyway.
Highlighted

Re: Command to list the status of a job from a client

@andrich2016 

I agree with the other experts.

Rather look at bparchive.

Accepted Solution!

Re: Command to list the status of a job from a client

hi @andrich2016 

Use the -w parameter if you need to check status of the bpbackup command.

When using the -w qualifier,  bpbackup wont return to the command prompt, but wait until the backup job is complete, and bpbackup exit code will be the status of the backup.

I have used the same trick many time before to ensure a client initiated backup is OK.

Exit code from a command in Linux/UNIX is stored in the variable $? and return value shoudl be check as first command after the bpbackup command. 

Pls See: https://www.cyberciti.biz/faq/bash-get-exit-code-of-command/

View solution in original post