Commit Graph

889 Commits

Author SHA1 Message Date
Emil Breiner
ad03bfa5c3 Replace -S in ssh/sftp cmd's with ssh options
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
2020-11-25 10:33:10 +01:00
Emil Breiner
a10d30cf1b Bugfix in scratch dir of borg.helper per sftp
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
2020-11-25 10:28:52 +01:00
Emil Breiner
e44ba0358f Bugfix in Borg.helper
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
2020-11-18 13:28:28 +01:00
emil.breiner
cf60e0e712 Rework the installation of ssh-keys via sftp 2020-11-18 13:28:28 +01:00
Emil Breiner
2827b17460 SFTP support including ssh-keys over sftp for handlers/borg.handler
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>
2020-11-18 13:28:28 +01:00
Emil Breiner
dc6e7ab74f Fix of declining the key comment redirecting to the main menu in the borg helper
Change-Id: I38eb6fb66552ec6664c5ff79251ff5c2702428a0
2020-09-22 11:17:09 +02:00
Emil Breiner
eea3cfada5 SSH-Key generation for helpers/borg.helper
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>
2020-08-28 16:16:42 +02:00
Emil Breiner
5fd29735b7 Bugfix for SFTP support handlers/borg
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>
2020-08-20 12:37:55 +02:00
Emil Breiner
fdacb1daa3 Replacing old backticks from command substitution
Change-Id: I9513f0847dacb483316e2cf4a7cf43759e33190b
Signed-off-by: Emil Breiner <emil.breiner@krumedia.com>
2020-08-20 12:35:22 +02:00
Guillaume Subiron
10b8887b8e Merge branch 'borg_cache_dir_location' into 'master'
Borg cache dir location

See merge request riseuplabs/backupninja!29
2020-08-14 05:46:34 -07:00
LeLutin
e28da8c390 borg: add configuration to displace the cache directory
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.
2020-08-14 05:46:34 -07:00
Guillaume Subiron
edcdf9dc52 Merge branch 'borg-port' into 'master'
handlers/borg: add port support

Closes #11296

See merge request riseuplabs/backupninja!31
2020-08-14 05:32:03 -07:00
Guillaume Subiron
9b6a5dedae Merge branch 'fix_authors' into 'master'
fix AUTHORS email address

See merge request riseuplabs/backupninja!26
2020-08-14 05:23:48 -07:00
Guillaume Subiron
0742c593b9 Merge branch 'patch-1' into 'master'
Update sys.in: add missing "disk" flag

See merge request riseuplabs/backupninja!24
2020-08-14 05:21:42 -07:00
tiredpixel
3d7494bfc2 handlers/borg: add port support
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.
2020-07-16 08:38:46 +00:00
Benjamin Maisonnas
797c09df36 fix AUTHORS email address 2020-01-26 22:39:08 +01:00
Julien Rabier
ac40f35542 Update sys.in to add missing "disk" flag.
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.
2019-02-04 09:12:12 -08:00
Jerome Charaoui
f9529d1d3f Remove zero-padding from nowday and whenday (fixes #9397)
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.
2018-07-13 21:59:43 -04:00
Jerome Charaoui
a0f5063e8b Fix warning about malformed day component in 'when' 2018-07-13 10:09:14 -04:00
Jerome Charaoui
26521d0975 Whitespace fixes 2018-07-13 10:09:14 -04:00
Jerome Charaoui
d9ca93ab91 Use -V instead of -v as shorthand for --version
The capital-V is more common as shorthand for --version, since many
commandline tools use -v as a shorthand for --verbose.
2018-07-02 16:08:02 -04:00
lavamind
fa8301c924 Merge branch 'version_option' into 'master'
New option "--version"

See merge request riseuplabs/backupninja!18
2018-07-02 13:04:54 -07:00
Aurélien Olivier
b8432d9862 New option "--version"
At build time, we use the version number provided by configure.ac, which
is updated upstream when there is a new release.
2018-06-30 00:32:51 +02:00
Jerome Charaoui
623b777add Releasing backupninja 1.1.0 2018-06-29 12:01:44 -04:00
Jerome Charaoui
a67ed16da6 Add contributor credits in ChangeLog 2018-06-29 12:00:11 -04:00
Jerome Charaoui
232079aa31 Fix typo in .gitignore 2018-06-29 11:45:32 -04:00
Jerome Charaoui
a7fd43b94a Add Vagrantfile
This should help with testing development code and new releases. To use,
just install vagrant and run vagrant up && vagrant ssh
2018-06-29 11:43:12 -04:00
Jerome Charaoui
1e78c5b4a1 Update references to configure.in 2018-06-29 11:14:06 -04:00
Jerome Charaoui
3384388267 Change configure.in suffix to ".ac"
The former is deprecated, and automake complains
2018-06-29 10:54:29 -04:00
Jerome Charaoui
c3aa57bcdb Update ChangeLog and AUTHORS 2018-06-27 20:49:08 -04:00
lavamind
464b84dcfe Merge branch 'patch-1' into 'master'
Fixes for configuration files without suffix.

Closes #11287

See merge request riseuplabs/backupninja!16
2018-06-27 17:35:03 -07:00
lavamind
cc289f4c87 Merge branch 'master' into 'master'
Error out if cache directory does not exist when creating a fresh dup backup

See merge request riseuplabs/backupninja!15
2018-06-27 17:34:46 -07:00
Jerome Charaoui
1b1a857cbf Make sfdisk grep for luks headers more specific 2018-06-27 20:33:46 -04:00
lavamind
012dc70f60 Merge branch 'feature/support_luks_partitions' into 'master'
Support LUKS in disk partitions

See merge request riseuplabs/backupninja!13
2018-06-27 17:32:09 -07:00
lavamind
fb3b45343b Merge branch 'patch-1' into 'master'
Exclude zram devices, they don't have a partition table

See merge request riseuplabs/backupninja!12
2018-06-27 17:31:56 -07:00
lavamind
497ff73b65 Merge branch 'fix_11285' into 'master'
Attempt to sanitize the database identifiers, fix #11285

Closes #11285

See merge request riseuplabs/backupninja!11
2018-06-27 17:31:13 -07:00
lavamind
177b4267e9 Merge branch 'borg_support' into 'master'
Borg support (rebased)

See merge request riseuplabs/backupninja!10
2018-06-27 17:30:54 -07:00
Lyz
417394cf74
Changed /sed/@SED@/ 2018-06-25 16:31:16 +02:00
Jerome Charaoui
0d9b10890e [borg] use alternative repo ssh location syntax
This adds the ability to specify an alternative SSH port within
the host variable.
2018-06-06 22:03:24 -04:00
Jerome Charaoui
1efa23869c [borg] improve comments in example.borg 2018-06-06 22:03:19 -04:00
Jerome Charaoui
9c3dffa2cd [borg] "repofile" is not a valid encryption mode 2018-06-06 22:03:12 -04:00
David Gasaway
877b094d14 Fixes for configuration files without suffix. 2018-05-05 12:36:16 -07:00
Hugh Nowlan
4725d7835f Correct path 2018-04-30 13:47:30 +01:00
Hugh Nowlan
f2bc6d60aa Error out if archive dir doesn't exist 2018-04-30 12:59:21 +01:00
Lyz
469a3fd5ab
Support LUKS in disk partitions 2018-04-30 12:29:23 +02:00
Glandos
90d0b9ff63 Exclude zram devices, they don't have a partition table 2018-03-24 06:23:26 -07:00
Jerome Charaoui
bc9be0d576 Attempt to sanitize the database identifiers
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.
2018-03-16 16:52:39 -04:00
Jerome Charaoui
0132b2453a [borg] scrap exclude*, add create_options
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".
2018-01-26 11:47:47 -05:00
Jerome Charaoui
e114ff68f4 [borg] remove unnecessary test on $keep 2018-01-26 11:37:04 -05:00
Jerome Charaoui
e9824c0d7d [borg] enable BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK
Otherwise the handler may hang, waiting for user input. This may occur
when the borg cache is deleted, or when borg is upgraded.
2018-01-26 11:32:04 -05:00