borgjs icon indicating copy to clipboard operation
borgjs copied to clipboard

Ability to set more environment variables

Open airbillion opened this issue 10 years ago • 17 comments

Would it be possible to add the ability to set a few more environment variables?

I do not keep my cache directory in my home folder. My scripts use the environment variable to set it to another location...

Can you add that capability?

Awesome project!

Thanks

airbillion avatar Oct 26 '16 14:10 airbillion

What we could do is to allow this in the config file. Just to let any option to pass through.

Something like

create: {
  compression: 'whatever'
...
}

Would you like to submit a PR?

vesparny avatar Oct 26 '16 15:10 vesparny

I think that would be a good solution.

I would like to help out with coding, but I would have no idea how to...I saw your project on the Borg Github page and gave it a shot...It looks great!

Is this something that you would want to implement?

Thanks!

airbillion avatar Oct 26 '16 16:10 airbillion

Yep, no worries.

I'll implement it in the next release.

vesparny avatar Oct 26 '16 16:10 vesparny

Awesome! Thanks...I look forward to it!

airbillion avatar Oct 26 '16 16:10 airbillion

Besides this, have you tried the lib? Is it working for you?

I'd love to hear from you, also about your setup for backups.

vesparny avatar Oct 26 '16 16:10 vesparny

The lib? Not sure what that is...is it a precompiled way to run borgjs?

I installed Borgjs on an Unraid server using the command: npm i -g borgjs

I have not had it run successfully yet though...When I tried it yesterday it errors out with an error about the lock file and another instance of Borgjs running.

As for Borg, I am using the Borg precomplied linux 64 file on 2 unraid servers...primary and backup.

Nightly, I call a script that I wrote which calls borg and pushes all my backup archives via ssh from my primary server to my backup.

Idealy, there would be a way to run Borgjs the same way I run the Borg binary...precompiled executable file for Linux...

I love your idea of using a config file to pass the info to your script...rather than borgmatic (https://torsion.org/borgmatic/), because I can keep that backed up an available on any machine...

airbillion avatar Oct 26 '16 16:10 airbillion

which version of borgjs are you running? I fixed a couple issues related to the file locking system.

Can you please check if you are running the latest?

vesparny avatar Oct 26 '16 18:10 vesparny

I was running the previous version...

Give me a few and I will let you know.

airbillion avatar Oct 26 '16 18:10 airbillion

The latest version works...no file lock error like before...However it will not use my current cache location which I have declared with an environment variable...so it will have to rebuild cache which is what I am trying to avoid.

airbillion avatar Oct 26 '16 19:10 airbillion

If it's set in aa env variable, borg should use it. A quick way to solve is to set the env variable while running the script

$ YOUR_ENV_VARIABLE=value borgjs -c ~/config.js

vesparny avatar Oct 26 '16 20:10 vesparny

passing the cache environment variable seems to have worked that way...thanks!

It still woudl be nice to pass it through with the config file though...

airbillion avatar Oct 26 '16 20:10 airbillion

I also need to be able to add the flag ignore inodes...

I pass that flag in my script so it does not add all files again in an archive...borg seems to need this flag when I backup to my remote server...

Sounds like a lot of work to make those changes to your script..

If you have the time and desire that would be awesome, but I completely understand if you do not see the value.

Thank you!

airbillion avatar Oct 26 '16 20:10 airbillion

I see the value of what you proposed. My tool is meant to enable people to use borg with ease, but it should not prevent customization.

Your idea of allowing borg flags to pass through the config file is valid. I will think about a sane way to implement this, and keep you posted in this thread.

Thanks for the feedback

vesparny avatar Oct 27 '16 11:10 vesparny

Understood...

Thank you for looking into being able to cusomize the options of your script!

I look forward to what you are able to make happen.

Thanks!

airbillion avatar Oct 27 '16 16:10 airbillion

Release 2.0.0 has been shipped. It supports custom environment variables and custom arbitrary borg options.

npm i -g borgjs

Please see the readme, you will have to adapt the config file. let me know how it goes

vesparny avatar Nov 09 '16 19:11 vesparny

Awesome job!!!

Tested it out and all env variables and options pass through correctly!

Thanks a lot...this will greatly simplify my back up script.

I really appreciate your work!!

Thanks again

airbillion avatar Nov 10 '16 18:11 airbillion

Cheers

vesparny avatar Nov 10 '16 20:11 vesparny