Works un Ubunt/Debian now
This commit is contained in:
parent
7df89cbba9
commit
d481469552
|
@ -25,8 +25,8 @@ define wmdeit_backup::borg_backup
|
|||
(
|
||||
$server = $title,
|
||||
$dirs = [],
|
||||
$encryption = "keyfile",
|
||||
$passphrase = "",
|
||||
$encryption = "repokey",
|
||||
$passphrase = "`/bin/cat /root/borg_passphrase.txt`",
|
||||
$ssh_user = 'root',
|
||||
$ssh_port = '22',
|
||||
$ssh_check_hostkey = 'no',
|
||||
|
@ -40,6 +40,8 @@ define wmdeit_backup::borg_backup
|
|||
$repos = $wmdeit_backup::borg::repos
|
||||
|
||||
$borg_cmd = $wmdeit_backup::borg::borg_cmd
|
||||
$sshfs_options = $wmdeit_backup::borg::sshfs_options
|
||||
|
||||
|
||||
$repo = "$repos/$title"
|
||||
|
||||
|
@ -62,7 +64,7 @@ define wmdeit_backup::borg_backup
|
|||
content => "#!/bin/sh
|
||||
export BORG_PASSPHRASE=$passphrase
|
||||
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
|
||||
CMD=\"$borg_cmd create ${repo}::$title-\${D} $backup_dirs\"
|
||||
\$CMD
|
||||
|
|
|
@ -12,8 +12,19 @@ class wmdeit_backup::params {
|
|||
]
|
||||
|
||||
$sshfs_cmd = '/usr/local/bin/sshfs'
|
||||
$sshfs_options = '-o direct_io' # buggy sshfs driver under freebsd
|
||||
$borg_cmd = "/usr/local/bin/borg"
|
||||
}
|
||||
'Debian': {
|
||||
$borg_packages = [
|
||||
"borgbackup",
|
||||
"sshfs",
|
||||
]
|
||||
$borg_cmd = "/usr/bin/borg"
|
||||
$sshfs_cmd = '/usr/bin/sshfs'
|
||||
|
||||
}
|
||||
|
||||
default: {
|
||||
|
||||
}}
|
||||
|
|
Loading…
Reference in New Issue