added winschoten backup to script
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user