Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Unfortunately that didn't work, i think it's because the commands are not one-liners and reasonably complex, one portion checks if a path is available before continuing or exiting, another part has 3 separately run Borg backup commands. Looking in the editor, the text colouring didn't seem right if the syntax was correct. I've updated the post to hopefully be more useful. Thanks for your suggestion. Commented Apr 10, 2020 at 12:07
  • @Derek It should work. The complexity of the commands don't matter at all, but you may want to export your BORG_REPO and LOGFILE variables to be able to access them inside the bash -c script. Commented Apr 10, 2020 at 12:15
  • You're right it does work - i did have variables in the full script, but there were some missing in my test script. Thanks both @Kusalananda and Jetchisel. I've updated the original question because while it works for the ultra-basic, i'm still having trouble with a couple of things that seem to be as a result of 'blocking' the commands inside the single quotes. Commented Apr 12, 2020 at 0:33
  • Exporting the password into a environment variable is not a good idea. A password shouldn't be in a script or passed to an environment variable. Commented May 25, 2021 at 10:19