resticprofile icon indicating copy to clipboard operation
resticprofile copied to clipboard

Populate a variable from command execution

Open WebSpider opened this issue 1 year ago • 2 comments

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?

WebSpider avatar Jun 27 '24 11:06 WebSpider

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 avatar Jun 27 '24 18:06 creativeprojects

version 0.27.0 is out 👍🏻

creativeprojects avatar Jun 27 '24 19:06 creativeprojects

Awesome, that works for me! :rocket:

WebSpider avatar Jul 05 '24 09:07 WebSpider