This commit is contained in:
matthias
2026-05-04 15:08:31 +02:00
parent 5163fdbb55
commit db43d95d87
+19 -13
View File
@@ -69,22 +69,28 @@ pipeline {
stage('Rsync TEST') { stage('Rsync TEST') {
failFast false failFast false
parallel { parallel {
steps { stage ('Run Backup to David') {
script { steps {
if (params.backuptodavid) { script {
sh "rsync -v -a -e 'ssh -p 664' --delete --bwlimit=3000 --info=progress2 ${env.borglocation}/${directory} matthias@home.daf2000.nl:/media/disk/borgbackup/" if (params.backuptodavid) {
} else { sh "rsync -v -a -e 'ssh -p 664' --delete --bwlimit=3000 --info=progress2 ${env.borglocation}/${directory} matthias@home.daf2000.nl:/media/disk/borgbackup/"
echo "Backup to David is skipped" } else {
echo "Backup to David is skipped"
}
} }
} }
script { }
if (params.backuptowinschoten) { stage ('Run Backup to Winschoten') {
withCredentials([sshUserPrivateKey(credentialsId: 'backupwinschoten', keyFileVariable: 'keyfile', passphraseVariable: 'passphrase', usernameVariable: 'user')]) { steps {
sh "cp ${keyfile} ${WORKSPACE}/keyfile" script {
sh "rsync -v -a -e 'ssh -i /home/backupwinschoten/.ssh/id_rsa -p 9897' --delete --info=progress2 ${env.borglocation}/${directory} backupwinschoten@localhost:/storage/borgbackups/" if (params.backuptowinschoten) {
withCredentials([sshUserPrivateKey(credentialsId: 'backupwinschoten', keyFileVariable: 'keyfile', passphraseVariable: 'passphrase', usernameVariable: 'user')]) {
sh "cp ${keyfile} ${WORKSPACE}/keyfile"
sh "rsync -v -a -e 'ssh -i /home/backupwinschoten/.ssh/id_rsa -p 9897' --delete --info=progress2 ${env.borglocation}/${directory} backupwinschoten@localhost:/storage/borgbackups/"
}
} else {
echo "Backup to Winschoten is skipped"
} }
} else {
echo "Backup to Winschoten is skipped"
} }
} }
} }