Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Iml Backup Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
IML Open Source
Iml Backup Server
Commits
3cd74416
Commit
3cd74416
authored
3 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
update imlbackup server - 2 new functions
* added params setactive and setinactive. * set basedir 1 level up.
parent
11384ca6
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
inc_config.sh.dist
+9
-3
9 additions, 3 deletions
inc_config.sh.dist
storage_helper.sh
+58
-1
58 additions, 1 deletion
storage_helper.sh
with
67 additions
and
4 deletions
inc_config.sh.dist
+
9
−
3
View file @
3cd74416
...
...
@@ -8,14 +8,20 @@
typeset -i iMaxConnections=10
typeset -i iConnections
sSelfdir="$( dirname $0 )"
# directory with backup data
sBackupBasedir="/netshare/one-backup"
# sublevel 1 is a name of backup tool
# sublevel 2 is a fqdn of a backed up server
# i.e. /netshare/restic-backup/server.example.com
sBackupBasedir="/netshare"
# where to store current connections
sConncectionDir="$sBackupBasedir/_active"
# sConncectionDir="${sBackupBasedir}/_active"
sConncectionDir="${sSelfdir}/_active_connections"
# log
sLogdir="
/opt/imlbackup/server/
"
sLogdir="
${sSelfdir}/log
"
sLogfile="$sLogdir/connections.log"
...
...
This diff is collapsed.
Click to expand it.
storage_helper.sh
+
58
−
1
View file @
3cd74416
...
...
@@ -37,6 +37,7 @@
# value is set in _showConnectionCount
iConnections
=
0
# ----------------------------------------------------------------------
# FUNCTIONS
# ----------------------------------------------------------------------
...
...
@@ -157,11 +158,57 @@
fi
}
function
_listRepodirs
(){
for
mydir
in
$(
ls
-1d
${
sBackupBasedir
}
/
*
/
*
|
grep
-vE
'(_active|somethinglsetodisable)'
)
do
echo
-n
"
$mydir
"
test
-f
"
$mydir
/inactive.txt"
&&
(
color error
;
echo
-n
"(inactive)"
)
test
-f
"
$mydir
/inactive.txt"
||
(
color ok
;
echo
-n
"(active)"
)
color reset
echo
done
}
# ----------------------------------------------------------------------
# PUBLIC FUNCTIONS
# ----------------------------------------------------------------------
function
PUBLIC_setactive
(){
echo
---
list of inactive backup repositories
_listRepodirs |
grep
'\(inactive\)'
echo
echo
-n
"Repo to activate again >"
read
inputdir
if
[
-f
"
$inputdir
/inactive.txt"
]
;
then
cat
"
$inputdir
/inactive.txt"
echo
echo
Removing
$inputdir
/inactive.txt
rm
-f
"
$inputdir
/inactive.txt"
echo
If it was a mistake run
$(
basename
$0
)
setinactive
else
echo
SKIP
[
$inputdir
]
fi
echo
}
function
PUBLIC_setinactive
(){
echo
---
list of backup repositories
_listRepodirs
echo
echo
-n
"Repo to deactivate >"
read
inputdir
if
[
-d
"
$inputdir
"
-a
!
-f
"
$inputdir
/inactive.txt"
]
;
then
echo
-n
"Short message >"
read
mymessage
echo
"
$(
date
)
|
$mymessage
"
>
"
$inputdir
/inactive.txt"
ls
-l
"
$inputdir
/inactive.txt"
else
echo
SKIP
[
$inputdir
]
fi
echo
}
# return backup directory for a client
function
PUBLIC_getBackupdir
(){
setBackupclient
$1
...
...
@@ -211,8 +258,10 @@
# show used slots
function
PUBLIC_status
(){
_showConnectionCount
echo
if
[
$iConnections
-gt
0
]
;
then
find
$sConncectionDir
-type
f
-exec
ls
-l
{}
\;
find
$sConncectionDir
-type
f
-exec
ls
-l
{}
\;
|
nl
echo
fi
exit
0
}
...
...
@@ -308,6 +357,14 @@
echo
" register | unregister [hostname]"
echo
" add/ remove slot for a backup client"
echo
echo
" setactive"
echo
" Reactivate an inctave backup repo."
echo
echo
" setinactive"
echo
" Mark a backup repo as inactive."
echo
" This prevents errors of missing backup data"
echo
" if a host is obsolete and was shut down."
echo
echo
" status"
echo
" show current reserved slots"
echo
...
...
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