Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
backupninja
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jipem
backupninja
Commits
45ed859b
Commit
45ed859b
authored
Mar 13, 2022
by
jipem
Browse files
Options
Downloads
Patches
Plain Diff
Update borg.in
Re-apply user modification after prune, not only after backup
parent
3e38406b
Branches
master
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
handlers/borg.in
+19
-1
19 additions, 1 deletion
handlers/borg.in
with
19 additions
and
1 deletion
handlers/borg.in
+
19
−
1
View file @
45ed859b
...
@@ -200,7 +200,7 @@ if [ $test = 0 ]; then
...
@@ -200,7 +200,7 @@ if [ $test = 0 ]; then
fi
fi
fi
fi
# in case of local backup, setting re
o
p files to correct user, if user is set
# in case of local backup, setting rep
o
files to correct user, if user is set
if
[
"
$host
"
==
"localhost"
]
&&
[
-n
"
$user
"
]
;
then
if
[
"
$host
"
==
"localhost"
]
&&
[
-n
"
$user
"
]
;
then
chownstr
=
"chown -Rf
$user
:
$user
$directory
"
chownstr
=
"chown -Rf
$user
:
$user
$directory
"
debug
"Setting appropriate files ownership"
debug
"Setting appropriate files ownership"
...
@@ -243,6 +243,24 @@ if [ "$prune" == "yes" ]; then
...
@@ -243,6 +243,24 @@ if [ "$prune" == "yes" ]; then
fatal
"Failed removing old backups."
fatal
"Failed removing old backups."
fi
fi
fi
fi
# in case of local backup, setting repo files to correct user, if user is set
if
[
"
$host
"
==
"localhost"
]
&&
[
-n
"
$user
"
]
;
then
chownstr
=
"chown -Rf
$user
:
$user
$directory
"
debug
"Setting appropriate files ownership"
debug
"
$nice
$chownstr
"
if
[
$test
=
0
]
;
then
output
=
`
$nice
su
-c
"
$chownstr
"
2>&1
`
if
[
$?
=
0
]
;
then
debug
$output
info
"Successfully changed repo user to
$user
"
else
error
$output
warning
"Failed to change repo user. Files ownership may be stuck to root"
fi
fi
fi
fi
fi
debug
"unset BORG_PASSPHRASE"
debug
"unset BORG_PASSPHRASE"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment