|
|
|
@ -4,6 +4,9 @@ class wmdeit_backup::borg (
|
|
|
|
|
$repos = $borg_repos,
|
|
|
|
|
$scripts = $borg_scripts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
inherits wmdeit_backup::params
|
|
|
|
@ -30,10 +33,15 @@ define wmdeit_backup::borg_backup
|
|
|
|
|
$ssh_user = 'root',
|
|
|
|
|
$ssh_port = '22',
|
|
|
|
|
$ssh_check_hostkey = 'no',
|
|
|
|
|
$borg_options = $wmdeit_backup::borg::borg_options,
|
|
|
|
|
|
|
|
|
|
$weekday = undef,
|
|
|
|
|
$hour = '0',
|
|
|
|
|
$minute = '0',
|
|
|
|
|
|
|
|
|
|
$retain_daily = '30',
|
|
|
|
|
$retain_monthly = '6',
|
|
|
|
|
$retain_yearly = '0',
|
|
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
$scripts = $wmdeit_backup::borg::scripts
|
|
|
|
@ -66,10 +74,13 @@ export BORG_PASSPHRASE=$passphrase
|
|
|
|
|
D=`date +%F`
|
|
|
|
|
$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=\"$borg_cmd create $borg_options ${repo}::$title-\${D} $backup_dirs\"
|
|
|
|
|
\$CMD
|
|
|
|
|
cd /
|
|
|
|
|
umount $mnt
|
|
|
|
|
PRUNECMD=\"$borg_cmd prune -d $retain_daily -m $retain_monthly -y $retain_yearly ${repo}\"
|
|
|
|
|
\$PRUNECMD
|
|
|
|
|
|
|
|
|
|
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|