From 0e1ebd27b68123e592417c49233ff5431be1032c Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 11 Jan 2026 20:43:05 +0100 Subject: [PATCH] try to add an exclude list --- jenkins/default_backup.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jenkins/default_backup.yml b/jenkins/default_backup.yml index a10a8b6..f77bd1f 100644 --- a/jenkins/default_backup.yml +++ b/jenkins/default_backup.yml @@ -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"