root
This commit is contained in:
@@ -7,7 +7,7 @@ pipeline {
|
|||||||
agent { label params['agentname'] }
|
agent { label params['agentname'] }
|
||||||
environment {
|
environment {
|
||||||
BORG_RELOCATED_REPO_ACCESS_IS_OK = 'yes'
|
BORG_RELOCATED_REPO_ACCESS_IS_OK = 'yes'
|
||||||
backdirectory = "${directory}"
|
backdirectory = "/"+ ${directory}"
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
@@ -21,8 +21,10 @@ pipeline {
|
|||||||
stage('Create local BorgBackup') {
|
stage('Create local BorgBackup') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
|
sh "mkdir -p ${WORKSPACE}/tmpmount"
|
||||||
|
sh "sshfs root@10.10.1.32:/${env.borglocation}/${directory}"
|
||||||
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 --exclude-from excludelist ${backdirectory}::${java.time.LocalDateTime.now().format(java.time.format.DateTimeFormatter.ofPattern('dd-MM-yyyy_HH:mm'))} ${backdirectory}"
|
sh "borg create --progress --stats --exclude-from excludelist ${backdirectory}::${java.time.LocalDateTime.now().format(java.time.format.DateTimeFormatter.ofPattern('dd-MM-yyyy_HH:mm'))} /${directory}"
|
||||||
sh "borg prune --list --keep-daily 31 --keep-weekly 48 ${backdirectory}"
|
sh "borg prune --list --keep-daily 31 --keep-weekly 48 ${backdirectory}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user