The sftp commands broke if the flag -S was used to specify the path to the master-socket. For consistency reasons the occurrences in the creation of the sockets were replaced too.
Change-Id: I412b6343c6ffd74208f18517a28dcba7cd2a58bb
The scratch directory for the authorized key file and the ssh socket was missing if the defined public key was already on the remote machine.
Change-Id: Ib64d6cab8a6f6bdf93f5f6ceb952f530cc135c10
The heredoc breaks the coping of the keys. The "-" at the redirect for the heredoc makes it possible to indent the end of the heredoc with tabs. Because spaces are used for indents the block breaks.
Change-Id: Ib5df720cbc85a792b132154bec823ed83957dab8
Hetzner storage boxes block off remote shells. Therefore the borg.helper needs SFTP support for moving keys to the remote repository, creating the repository directoy and testing the permissions.
Change-Id: Id37389d5724ce55555325a8651a8b6430144de20
Signed-Off-By: Emil Breiner <emil.breiner@krumedia.com>
Generating a RSA 4096 key pair for Borgbackup with ssh-keygen and a custom location for the keypair including input for a comment.
Change-Id: I944117307cc2408a2aece2506424844f0417d9de
Signed-off-by: Emil Breiner <emil.breiner@krumedia.com>
If the ssh connection test fails and the borg repository wasn't initialized the test runs into a "Fatal: Can't connect" although connecting was successful.
Change-Id: I9fef6c011d628d38f92257cb0339f590bef00487
Signed-off-by: Emil Breiner <emil.breinr@krumedia.com>
borg will by default create its cache directory in ~/.cache/borg. This
means that during backup runs, borg will read and write quite
extensively from/to this directory.
In some situations, it is rather undesirable to have this amount of IO
activity in this location and it would make sense to tell borg to place
its cache elsewhere. This can help for example with placing the cache on
a hard drive where the added IO load will not have as big of an impact
on other running activity for the system.
This change also makes sure that the cache directory environment
variable is cleared out when the configuration option is unset. This
should avoid unpleasant surprises when this environment variable is set
to some unknown value in the context where backupninja is called, which
could lead to borg reading and writing to random places on the system.
This enables the handlers to be used for hosts which use a non-standard
port, such as is offered by some commercial services. Default to port
22, so it's optional and backwards-compatible.
It seems like only the short output of hwinfo --disk is provided to hardware.txt. I'd suggest we also add disk to the flags for the "complete" output.
That's especially useful when you need to indicate the serial number of a dead drive in order for it to be replaced. Once the disk is dead, using hardware.txt can be the only way to retrieve this info.
This fixes cases where the day component of the when parameter resolved
to a non-zero padded integer under 10, such as "when = 1st at 01"
The comparison against the nowday variable failed consistently since
the date command format used always returned a zero-padded two digit
integer.
The solution chosen is to avoid generating nowday with zero-padding and
remove any zero-padding from whenday parameter using a more thorough
sed pattern which now also removes any non-alphanumeric characters from
the string.
Removing the quote and semicolon characters should be sufficient to
prevent breaking out of the shell command, but this may need reviewed
by someone more knowlegeable in shell scripting.
This allows the handler to fully make use of the advanced command-line
options for "borg create", such as the replaced "exclude*" options and
others like "--read-special" and "--numeric-owner".