Works un Ubunt/Debian now

This commit is contained in:
Charlie Root 2021-06-25 17:28:11 +02:00
parent 7df89cbba9
commit d481469552
2 changed files with 16 additions and 3 deletions

View File

@ -25,8 +25,8 @@ define wmdeit_backup::borg_backup
( (
$server = $title, $server = $title,
$dirs = [], $dirs = [],
$encryption = "keyfile", $encryption = "repokey",
$passphrase = "", $passphrase = "`/bin/cat /root/borg_passphrase.txt`",
$ssh_user = 'root', $ssh_user = 'root',
$ssh_port = '22', $ssh_port = '22',
$ssh_check_hostkey = 'no', $ssh_check_hostkey = 'no',
@ -40,6 +40,8 @@ define wmdeit_backup::borg_backup
$repos = $wmdeit_backup::borg::repos $repos = $wmdeit_backup::borg::repos
$borg_cmd = $wmdeit_backup::borg::borg_cmd $borg_cmd = $wmdeit_backup::borg::borg_cmd
$sshfs_options = $wmdeit_backup::borg::sshfs_options
$repo = "$repos/$title" $repo = "$repos/$title"
@ -62,7 +64,7 @@ define wmdeit_backup::borg_backup
content => "#!/bin/sh content => "#!/bin/sh
export BORG_PASSPHRASE=$passphrase export BORG_PASSPHRASE=$passphrase
D=`date +%F` D=`date +%F`
$wmdeit_backup::borg::sshfs_cmd -oStrictHostKeyChecking=$ssh_check_hostkey -oPort=$ssh_port $ssh_user@$server:/ $mnt $wmdeit_backup::borg::sshfs_cmd $sshfs_options -oStrictHostKeyChecking=$ssh_check_hostkey -oPort=$ssh_port $ssh_user@$server:/ $mnt
cd $mnt cd $mnt
CMD=\"$borg_cmd create ${repo}::$title-\${D} $backup_dirs\" CMD=\"$borg_cmd create ${repo}::$title-\${D} $backup_dirs\"
\$CMD \$CMD

View File

@ -12,8 +12,19 @@ class wmdeit_backup::params {
] ]
$sshfs_cmd = '/usr/local/bin/sshfs' $sshfs_cmd = '/usr/local/bin/sshfs'
$sshfs_options = '-o direct_io' # buggy sshfs driver under freebsd
$borg_cmd = "/usr/local/bin/borg" $borg_cmd = "/usr/local/bin/borg"
} }
'Debian': {
$borg_packages = [
"borgbackup",
"sshfs",
]
$borg_cmd = "/usr/bin/borg"
$sshfs_cmd = '/usr/bin/sshfs'
}
default: { default: {
}} }}