pipeline { agent any stages { stage ('Run Backup to David') { steps { script { 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.julienbackuplocation} backupwinschoten@localhost:/storage/backup_julien" } } } } } }