a
This commit is contained in:
@@ -8,6 +8,9 @@ pipeline {
|
|||||||
string(name: 'directory', defaultValue: params.directory ?: ' ', description: 'The directory that should be handled')
|
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')
|
text(name: 'excludelist', defaultValue: params.excludelist ?: '**/cache/** ', description: 'Multiline string to exclude patterns from backup')
|
||||||
}
|
}
|
||||||
|
environment {
|
||||||
|
BORG_RELOCATED_REPO_ACCESS_IS_OK = 'yes'
|
||||||
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('Run Information') {
|
stage('Run Information') {
|
||||||
steps {
|
steps {
|
||||||
@@ -32,7 +35,6 @@ pipeline {
|
|||||||
script {
|
script {
|
||||||
if (params.backuplocally) {
|
if (params.backuplocally) {
|
||||||
withCredentials([string(credentialsId: 'cbce976a-0d98-4f35-8ea2-1f7818931bc3', variable: 'BORG_PASSPHRASE')]) {
|
withCredentials([string(credentialsId: 'cbce976a-0d98-4f35-8ea2-1f7818931bc3', variable: 'BORG_PASSPHRASE')]) {
|
||||||
sh "export BORG_RELOCATED_REPO_ACCESS_IS_OK=yes"
|
|
||||||
sh "borg create --progress --stats --exclude-from excludelist ${env.borglocation}/${directory}::${java.time.LocalDateTime.now().format(java.time.format.DateTimeFormatter.ofPattern('dd-MM-yyyy_HH:mm'))} ${env.storagelocation}/${directory}"
|
sh "borg create --progress --stats --exclude-from excludelist ${env.borglocation}/${directory}::${java.time.LocalDateTime.now().format(java.time.format.DateTimeFormatter.ofPattern('dd-MM-yyyy_HH:mm'))} ${env.storagelocation}/${directory}"
|
||||||
sh "borg prune --list --keep-daily 31 --keep-weekly 48 ${env.borglocation}/${directory}"
|
sh "borg prune --list --keep-daily 31 --keep-weekly 48 ${env.borglocation}/${directory}"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user