proxmox-backup-client notification on failed/successful backup

nordicaussie

New Member
Jun 11, 2024
1
1
1
Hi there!

I'm trying to configure a way to get notified if a proxmox-backup-client job is successful or failed.

I can't see any post-hook or anything like that, i'm currently running it as a cron job.

There is mention of a --output-format in the documentation, but when I put that in the command, it doesn't accept it, I also tried the environment variable, and that seemed to do nothing.

Does anyone have a way of using the output to trigger notifications based on whether the backup was successful or not?

Thanks!
 
  • Like
Reactions: guletz
I'm trying to configure a way to get notified
There is a whole chapter for this in the official documentation: https://pbs.proxmox.com/docs/notifications.html

based on whether
That's probably controlled by a "matcher": https://pbs.proxmox.com/docs/notifications.html#notification-matchers


Disclaimer: I am just using the classic mechanism, now called "mail-to-root"...

----
Edit: I reread your post and realized you are talking about the cli client. So please ignore my post...
 
Last edited:
Same problem here. I even set the matcher on PBS notifications to "Any" without any additional criteria and I'm getting nothing. I used to get verify, prune and gc notices when they completed (success or failure) now I get bumkus. Test notification always works though.
 
So I've now set up both direct to Gmail with authentication as well as local postfix and the default notification settings that were already present. Tests work for all 3 but from my testing it looks like only events triggered from the Datastore -> DatastoreName screen will trigger any notifications. If you have a bare-metal client backing up with proxmox-backup-client, zero notifications will fire upon completion even if they include prune and verify flags. If you manually trigger a scheduled job (gc, prune, verify, etc) from the management screen then you will get a notification when it completes. That means that only a partial group of the notifications currently work from the instructions on the documentation page. For instance, package updates aren't working, nor are the ones that match "system-mail"
 
Last edited:
  • Like
Reactions: Dark26
Im too, getting no notifications at all, from the manuel triggered jobs or per shedule. Test notifications allways work.
 
Im too, getting no notifications at all, from the manuel triggered jobs or per shedule. Test notifications allways work.

What's your /etc/proxmox-backup/notifications.cfg ?
Is the Notification mode for your datastores set to 'Notification System' (Datastore > Options > Notification mode)?
 
What's your /etc/proxmox-backup/notifications.cfg ?
Is the Notification mode for your datastores set to 'Notification System' (Datastore > Options > Notification mode)?
Code:
root@pbs:~# cat /etc/proxmox-backup/notifications.cfg
sendmail: mail-to-root
        comment Send mails to root@pam's email address
        mailto-user root@pam

matcher: default-matcher
        comment Route everything but successful prune job notifications to mail-to-root
        invert-match true
        match-field exact:type=prune
        match-severity info
        mode all
        target mail-to-root
        target Telegram-Test

webhook: Telegram-Test
        method post
        url https://api.telegram.org/bot{{ secrets.BOT_TOKEN }}/sendMessage?chat_id={{ secrets.CHAT_ID }}&text={{ url-encode "PVE Backupserver Notification" }}%0A%0ATitle:+{{ url-encode title }}%0AMessage:+{{ url-encode message }}%0ASeverity:+{{ url-encode severity }}%0ATime:+{{ timestamp }}

matcher: TG-Test
        match-field exact:type=verify
        mode any
        target Telegram-Test
        target mail-to-root

matcher: All
        mode all
        target Telegram-Test
        target mail-to-root
root@pbs:~#

1737659385648.png
The matcher: All is copied from PVE where it works.
 
Still an issue (in 3.4.1). I'm successfully getting notifications for verificationjob and syncjob, but not for backup. My matcher is very simple: Screenshot 2025-09-17 at 21.52.48.png
 
I've encountered another issue, and now I think that proxmox-backup-client should incorporate (some kind of) notifications itself.

Usecase:
1. Remote host with backup client.
2. PBS in LAN.
3. The tunnel (VPN/SSH doesn't matter) between the remote host and PBS.
4. The tunnel is down for some reason.
5. The client can't connect to PBS and thus can't even start a backup.
6. ??????
7. PROFIT!!! No backups and no notifications as a result. I've found it out by chance.
 
Although I haven't found any mention in the man page at
https://pbs.proxmox.com/docs/proxmox-backup-client/man1.html
proxmox-backup-client has various "exit codes" / "exit statuses", which you could check in the backup script.

Like in most Linux/Unix programs exit code 0 means "no issues".

# proxmox-backup-client help
...
# echo $?
0

Other exit statuses mean various kinds of problems. E.g.:

# proxmox-backup-client snapshot list
Error: unable to get (default) repository
# echo $?
255

I don't use proxmox-backup-client so I can't easily find whether there are more specific exit codes for particular failures, but at least status other than 0 means some failure.

So in the backup script you can check the exit code and execute some action depending on the exit code.

Here you are a simulation in the command line:

# proxmox-backup-client help
...
# EXITCODE=$?
# test $EXITCODE -eq 0 && echo "Success." || echo "There was some problem."
Success.

# proxmox-backup-client list
Error: unable to get (default) repository
# EXITCODE=$?
# test $EXITCODE -eq 0 && echo "Success." || echo "There was some problem."
There was some problem.
 
Although I haven't found any mention in the man page at
https://pbs.proxmox.com/docs/proxmox-backup-client/man1.html
proxmox-backup-client has various "exit codes" / "exit statuses", which you could check in the backup script.

Like in most Linux/Unix programs exit code 0 means "no issues".

# proxmox-backup-client help
...
# echo $?
0

Other exit statuses mean various kinds of problems. E.g.:

# proxmox-backup-client snapshot list
Error: unable to get (default) repository
# echo $?
255

I don't use proxmox-backup-client so I can't easily find whether there are more specific exit codes for particular failures, but at least status other than 0 means some failure.

So in the backup script you can check the exit code and execute some action depending on the exit code.

Here you are a simulation in the command line:

# proxmox-backup-client help
...
# EXITCODE=$?
# test $EXITCODE -eq 0 && echo "Success." || echo "There was some problem."
Success.

# proxmox-backup-client list
Error: unable to get (default) repository
# EXITCODE=$?
# test $EXITCODE -eq 0 && echo "Success." || echo "There was some problem."
There was some problem.
Well, PBS and PVE have a working solution for notifications, and I don't want to reinvent the wheel.