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
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Liberate
backupninja
Commits
7f075c1e
Commit
7f075c1e
authored
14 years ago
by
rhatto
Browse files
Options
Downloads
Patches
Plain Diff
Fixing lockfile checks for rsync handler
parent
9fe6ebf3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
handlers/rsync.in
+25
-1
25 additions, 1 deletion
handlers/rsync.in
with
25 additions
and
1 deletion
handlers/rsync.in
+
25
−
1
View file @
7f075c1e
...
@@ -847,7 +847,13 @@ function test_connect {
...
@@ -847,7 +847,13 @@ function test_connect {
function
set_lockfile
{
function
set_lockfile
{
if
[
!
-z
"
$lockfile
"
]
;
then
if
[
!
-z
"
$lockfile
"
]
;
then
$touch
$lockfile
||
warning
"Could not create lockfile
$lockfile
"
mkdir
-p
`
dirname
$lockfile
`
if
(
set
-o
noclobber
;
echo
"
$$
"
>
"
$lockfile
"
)
&> /dev/null
;
then
trap
'rm -f "$lockfile"'
INT TERM EXIT
else
info
"Could not create lockfile
$lockfile
, exiting"
exit
fi
fi
fi
}
}
...
@@ -860,6 +866,23 @@ function unset_lockfile {
...
@@ -860,6 +866,23 @@ function unset_lockfile {
}
}
function
check_lockfile
{
local
pid
if
[
!
-z
"
$lockfile
"
]
&&
[
-f
"
$lockfile
"
]
;
then
pid
=
"
`
cat
$lockfile
`
"
if
ps
$pid
&> /dev/null
;
then
info
"Another backup is running for
$lockfile
, skipping run"
exit
else
info
"Found old lockfile
$lockfile
, removing it"
unset_lockfile
fi
fi
}
function
set_filelist
{
function
set_filelist
{
filelist_flag
=
""
filelist_flag
=
""
...
@@ -1045,6 +1068,7 @@ function end_mux {
...
@@ -1045,6 +1068,7 @@ function end_mux {
# the backup procedure
# the backup procedure
eval_config
eval_config
check_lockfile
set_lockfile
set_lockfile
set_rsync_options
set_rsync_options
start_mux
start_mux
...
...
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