added switch to winschoten option
This commit is contained in:
@@ -5,6 +5,7 @@ pipeline {
|
||||
booleanParam(name: 'backuptostackstorage', defaultValue: params.backuptostackstorage ?: false, description: 'If true backup data to TransIP Stack')
|
||||
booleanParam(name: 'backuptodavid', defaultValue: params.backuptodavid ?: false, description: 'If true rsync the BORG repository to David')
|
||||
booleanParam(name: 'backuptopi', defaultValue: params.backuptopi ?: false, description: 'If true rsync the BORG repository to our ExternalPI')
|
||||
booleanParam(name: 'backuptowinschoten', defaultValue: params.backuptowinschoten ?: false, description: 'If true rsync the BORG repository to our Winschoten backup system')
|
||||
string(name: 'directory', defaultValue: params.directory ?: ' ', description: 'The directory that should be handled')
|
||||
text(name: 'excludelist', defaultValue: params.excludelist ?: '**/cache/** ', description: 'Multiline string to exclude patterns from backup')
|
||||
}
|
||||
@@ -92,7 +93,7 @@ pipeline {
|
||||
stage('Run Rsync Backup to Winschoten') {
|
||||
steps {
|
||||
script {
|
||||
if (params.backuptopi) {
|
||||
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/borgbackup/.ssh/id_rsa -p 9897' --delete --info=progress2 ${env.borglocation}/${directory} backupwinschoten@localhost:/storage/borgbackups/${directory}"
|
||||
|
||||
Reference in New Issue
Block a user