try to add an exclude list

This commit is contained in:
2026-01-11 20:43:05 +01:00
parent db8dd1c799
commit 0e1ebd27b6

View File

@@ -5,6 +5,7 @@ pipeline {
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: '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 {
stage('Run Information') {
@@ -13,6 +14,8 @@ pipeline {
echo "Backup to TransIP Stack is ${params.backuptostackstorage}"
echo "Backup to David is ${params.backuptodavid}"
echo "Backup to External PI is ${params.backuptopi}"
echo "Excludelist: ${params.excludelist}"
sh "echo ${params.excludelist} >> excludelist"
}
}
stage('Getting RClone Configuration') {
@@ -28,7 +31,8 @@ pipeline {
script {
if (params.backuplocally) {
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 {
echo "Local BORG backup creation is skipped"