.Task Hook variable includes unexpected prefix text #837
-
Hi, According to the documentation, the .Task variable is expected to be the name of the task (plan?). However, I noticed that it also includes the leading text "backup for plan " — for example:
This adds extra complexity when using the value in automated reports or integrations, especially when formatting output in other languages or generating user-facing notifications. One has to manually strip out the prefix to get the actual task name. Is this intentional? If so, it would be helpful to clarify this behavior in the documentation. If not, perhaps the variable could be adjusted to return only the task name itself. It’s not a big issue — I’ve worked around it — but it would make the .Task value much easier to use directly if it only contained the core identifier. Thanks for a great tool! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hey -- if I understand correctly you're trying to find the ID of the Plan or the name of the Repo that the task is running under? The structure of hookvars is backrest/internal/orchestrator/tasks/hookvars.go Lines 18 to 28 in 85ec74f You can access the repo as |
Beta Was this translation helpful? Give feedback.
-
I was building a status monitor within HomeAssistant. It shows latest run times, number of files added, etc. Everything works fine. Lets say I have a plan called "vmstore-to-azure" Im using the .Task variable. and it returns this But when thinking of it, I dont see "Task" mentioned anywhere else, so perhaps I am misunderstanding the meaning of that variable. I am using this as the HOOK command The data I receive in the other end is this: |
Beta Was this translation helpful? Give feedback.
Hey -- if I understand correctly you're trying to find the ID of the Plan or the name of the Repo that the task is running under?
The structure of hookvars is
backrest/internal/orchestrator/tasks/hookvars.go
Lines 18 to 28 in 85ec74f