Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iml-backup
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
IML Open Source
iml-backup
Merge requests
!62
move sequence and security file on delete
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
move sequence and security file on delete
couchdb-dump-security
into
master
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
move sequence and security file on delete
Hahn Axel (hahn)
requested to merge
couchdb-dump-security
into
master
Apr 14, 2022
Overview
0
Commits
1
Pipelines
0
Changes
1
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
517739f5
1 commit,
Apr 14, 2022
1 file
+
9
−
7
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
plugins/localdump/couchdb2.sh
+
9
−
7
View file @ 517739f5
Edit in single-file editor
Open in Web IDE
Show full file
@@ -143,12 +143,12 @@ function doBackup(){
function
_doBackupOfSingleInstance
(){
create_targetdir
mkdir
-p
"
${
BACKUP_TARGETDIR
}
/
${
COUCHDB_INSTANCE
}
"
2>/dev/null
mkdir
-p
"
${
ARCHIVE_DIR
}
/
${
COUCHDB_INSTANCE
}
/seq"
2>/dev/null
mkdir
-p
"
${
ARCHIVE_DIR
}
/
${
COUCHDB_INSTANCE
}
/security"
2>/dev/null
local
ARCHIVE_DIR2
=
"
${
ARCHIVE_DIR
}
/
${
COUCHDB_INSTANCE
}
/deleted_databases"
test
-d
"
${
ARCHIVE_DIR2
}
"
||
mkdir
-p
"
${
ARCHIVE_DIR2
}
"
2>/dev/null
for
_dir
in
"
${
BACKUP_TARGETDIR
}
/
${
COUCHDB_INSTANCE
}
"
"
${
ARCHIVE_DIR
}
/
${
COUCHDB_INSTANCE
}
/seq"
"
${
ARCHIVE_DIR
}
/
${
COUCHDB_INSTANCE
}
/security"
\
"
${
ARCHIVE_DIR2
}
"
"
${
ARCHIVE_DIR2
}
/seq"
"
${
ARCHIVE_DIR2
}
/security"
do
test
-d
"
$_dir
"
||
(
echo
"creating
$_dir
"
;
mkdir
-p
"
$_dir
"
)
done
echo
echo
" MOVE deleted databases into
${
ARCHIVE_DIR2
}
"
@@ -165,9 +165,11 @@ function _doBackupOfSingleInstance(){
dbname
=
$(
basename
$dumpfile
|
sed
"s#
\.
couchdbdump
\.
gz##g"
)
if
!
grep
"^
${
dbname
}
"
"
$dblist
"
>
/dev/null
;
then
SEQFILE
=
${
ARCHIVE_DIR
}
/
${
COUCHDB_INSTANCE
}
/seq/__seq__
${
dbname
}
SECURITYFILE
=
${
ARCHIVE_DIR
}
/
${
COUCHDB_INSTANCE
}
/security/__security__
${
dbname
}
.json
echo
"DELETED
$dbname
...
$(
ls
-l
${
dumpfile
}
|
cut
-f
5-
-d
' '
)
"
mv
"
${
dumpfile
}
"
"
${
ARCHIVE_DIR2
}
"
rm
-f
"
${
SEQFILE
}
"
mv
"
${
SEQFILE
}
"
"
${
ARCHIVE_DIR2
}
/seq/"
mv
"
${
SECURITYFILE
}
"
"
${
ARCHIVE_DIR2
}
/security/"
fi
done
# done | tee /tmp/couch_archive_${COUCHDB_INSTANCE}.txt
Loading