Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
deploy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
paradise
deploy
Commits
343ff05d
There was an error fetching the commit references. Please try again later.
Commit
343ff05d
authored
3 years ago
by
Vladimír Štill
Browse files
Options
Downloads
Patches
Plain Diff
backup-tar: Make standalone config file possible
parent
d7e1025a
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
backup-tar/backup.sh
+10
-5
10 additions, 5 deletions
backup-tar/backup.sh
with
10 additions
and
5 deletions
backup-tar/backup.sh
+
10
−
5
View file @
343ff05d
...
@@ -13,11 +13,16 @@ fail() {
...
@@ -13,11 +13,16 @@ fail() {
exit
1
exit
1
}
}
SHORT_HOST
=
$(
hostname
-s
)
if
[[
$1
]]
;
then
TARGET
=
backup-
$SHORT_HOST
@antea
.
$1
SOURCES_FILE
=
$SCRIPT_DIR
/sources_
$SHORT_HOST
else
.
$SOURCES_FILE
SHORT_HOST
=
$(
hostname
-s
)
[[
$SOURCES
]]
||
fail
"SOURCES expected to be set in
$SOURCES_FILE
"
TARGET
=
backup-
$SHORT_HOST
@antea
SOURCES_FILE
=
$SCRIPT_DIR
/sources_
$SHORT_HOST
.
$SOURCES_FILE
fi
[[
$TARGET
]]
||
fail
"TARGET expected to be set in config"
[[
$SOURCES
]]
||
fail
"SOURCES expected to be set in
$SOURCES_FILE
or config"
TIMESTAMP
=
$(
date
+
"%Y-%m-%d"
)
TIMESTAMP
=
$(
date
+
"%Y-%m-%d"
)
mkdir
lock
||
fail
"ERROR: backup already in progress (lock dir exists)"
mkdir
lock
||
fail
"ERROR: backup already in progress (lock dir exists)"
...
...
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