try to add an exclude list
This commit is contained in:
@@ -5,6 +5,7 @@ pipeline {
|
|||||||
booleanParam(name: 'backuptostackstorage', defaultValue: false, description: 'If true backup data to TransIP Stack')
|
booleanParam(name: 'backuptostackstorage', defaultValue: false, description: 'If true backup data to TransIP Stack')
|
||||||
booleanParam(name: 'backuptodavid', defaultValue: false, description: 'If true rsync the BORG repository to David')
|
booleanParam(name: 'backuptodavid', defaultValue: false, description: 'If true rsync the BORG repository to David')
|
||||||
booleanParam(name: 'backuptopi', defaultValue: false, description: 'If true rsync the BORG repository to our ExternalPI')
|
booleanParam(name: 'backuptopi', defaultValue: false, description: 'If true rsync the BORG repository to our ExternalPI')
|
||||||
|
text(name: 'borgexclude', defaultValue: '**/cache**, **/preview/**', description: 'List of directories or files to exclude')
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('Run Information') {
|
stage('Run Information') {
|
||||||
@@ -13,6 +14,8 @@ pipeline {
|
|||||||
echo "Backup to TransIP Stack is ${params.backuptostackstorage}"
|
echo "Backup to TransIP Stack is ${params.backuptostackstorage}"
|
||||||
echo "Backup to David is ${params.backuptodavid}"
|
echo "Backup to David is ${params.backuptodavid}"
|
||||||
echo "Backup to External PI is ${params.backuptopi}"
|
echo "Backup to External PI is ${params.backuptopi}"
|
||||||
|
echo "Excludelist: ${params.excludelist}"
|
||||||
|
sh "echo ${params.excludelist} >> excludelist"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Getting RClone Configuration') {
|
stage('Getting RClone Configuration') {
|
||||||
@@ -28,7 +31,8 @@ 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 "borg create --progress --stats ${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}"
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
echo "Local BORG backup creation is skipped"
|
echo "Local BORG backup creation is skipped"
|
||||||
|
|||||||
Reference in New Issue
Block a user