added winschoten backup to script

This commit is contained in:
matthias
2026-04-02 07:22:33 +02:00
parent fc31941b12
commit 737961782c
+14
View File
@@ -89,5 +89,19 @@ pipeline {
} }
} }
} }
stage('Run Rsync Backup to Winschoten') {
steps {
script {
if (params.backuptopi) {
withCredentials([sshUserPrivateKey(credentialsId: 'backupwinschoten', keyFileVariable: 'keyfile', passphraseVariable: 'passphrase', usernameVariable: 'user')]) {
sh "cp ${keyfile} ${WORKSPACE}/keyfile"
sh "rsync -v -a -e 'ssh -i /home/borgbackup/.ssh/id_rsa -p 9897' --delete --info=progress2 ${env.borglocation}/${directory} backupwinschoten@localhost:/storage/borgbackups/${directory}"
}
} else {
echo "Backup to External PI is skipped"
}
}
}
}
} }
} }