creativeprojects / resticprofile

Configuration profiles manager and scheduler for restic backup
https://creativeprojects.github.io/resticprofile/
GNU General Public License v3.0
604 stars 29 forks source link

Populate a variable from command execution #373

Closed WebSpider closed 1 week ago

WebSpider commented 2 weeks ago

Is it possible to use command executions to populate a variable in resticprofile?

Example:

The application I want to backup uses user-configurable storage paths, and I want to back them up as I perform application backups, so I need to ask the application to give me a list of locations where it has stored stuff.

curl https://my.app/api/v1/storage-locations gives me back a list with storage locations, and I'd like to use that to populate the sources directive.

I've found ways to assign variables directly, and I've found ways to reference environment variables, so I could write a wrapper around resticprofile to first get the stuff I need, store it in the environment and then call resticprofile, but this seems counter-intuitive.

Is there any other way that I can do this natively?

creativeprojects commented 2 weeks ago

Hey!

Actually you can already do that with a feature waiting to be released:

https://github.com/creativeprojects/resticprofile/pull/323

Would that work for you?

You can try to compile resticprofile from the main branch if you want to test it out.

I guess a new release is overdue 😆

creativeprojects commented 2 weeks ago

version 0.27.0 is out 👍🏻

WebSpider commented 1 week ago

Awesome, that works for me! :rocket: