[Borgbackup] [IDEA] Add support for external commands

Melkor Lord melkor.lord at gmail.com
Sat Oct 1 19:38:28 EDT 2016


On Sat, Oct 1, 2016 at 8:45 PM, Walker Traylor <wtraylor at areyouthinking.org>
wrote:

"PS: I know we currently can do something like :
> ssh user at host "do-stuff" | borg create /path/to/repo::name
> but this lacks the more thorough controls borg could achieve by wrapping
> all the process."
>
> What more thorough controls do you require?
>

Quite simple : if "do-stuff" fails for some reason, there's a lot of work
to determine how to suppress the "failed" backup that Borg's going to make
anyway.

ssh user at host "echo '' ; /bin/false" | borg create /path/to/repo::test -

see? Now there's a "test" backup which is empty and serves no purpose at
all. Because of the pipe, I don't know that the ssh command failed. Borg
didn't fail but I have no way to distinguish "test" between "legit but no
new data" from "failed empty useless data" type of backup.

As I see it coming, NO, I will NOT use Bash for scripting to get the
$PIPESTATUS variable because Bash isn't available everywhere. I love Bash
for my everyday shell usage but I never use it in scripts, I require
/bin/sh (dash on Debian and derivatives) because POSIX scripts work
everywhere the same way without side effets (dash, busybox ash, whatever
POSIX compliant shell).

Borg (serve) wrapping the command could detect the failure (and all cases
with the --skip-cmd-fail=x,y,z) and notify the calling Borg to not create
the backup.

Hope it's clear.

-- 
Unix _IS_ user friendly, it's just selective about who its friends are.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/borgbackup/attachments/20161002/c3cf1708/attachment.html>


More information about the Borgbackup mailing list