Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-mysqlbackend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
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
Code review analytics
Issue 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
caosdb
Software
caosdb-mysqlbackend
Commits
d64dc6db
Commit
d64dc6db
authored
5 years ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
MAINT: trying to reuse existing code
parent
3a51a628
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
backup.sh
+0
-1
0 additions, 1 deletion
backup.sh
log.py
+0
-22
0 additions, 22 deletions
log.py
log.sh
+43
-0
43 additions, 0 deletions
log.sh
with
43 additions
and
23 deletions
backup.sh
+
0
−
1
View file @
d64dc6db
...
...
@@ -40,7 +40,6 @@ function backup {
NARG_NAME
=
$1
NARG_FILE
=
$2
shift
2
echo
$MYSQLDUMP_CMD
# parameters: connection, database, outfile
if
[
-e
"
$NARG_FILE
"
]
;
then
failure
"dumpfile already exists."
...
...
This diff is collapsed.
Click to expand it.
log.py
+
0
−
22
View file @
d64dc6db
...
...
@@ -31,28 +31,6 @@ SQL_BASE = ["mysql", "--batch",
"
--user=caosdb
"
,
"
--password=random1234
"
,
"
--host=sqldb
"
,
"
--port=3306
"
]
test_yaml
=
"""
action: log
log_action: storeoff
"""
def
exec
(
args
):
"
Executing the logging action action.
"
action
=
args
[
"
log_action
"
]
result
=
None
if
action
.
startswith
(
"
store
"
):
result
=
{
"
tsv_content
"
:
_store_log
()}
if
action
.
endswith
(
"
on
"
):
_logging
(
True
)
elif
action
.
endswith
(
"
off
"
):
_logging
(
False
)
return
result
def
_store_log
():
"""
Retrieves the log table and returns it as a TSV string.
...
...
This diff is collapsed.
Click to expand it.
log.sh
0 → 100755
+
43
−
0
View file @
d64dc6db
#!/bin/bash
#
# ** header v3.0
# This file is a part of the CaosDB Project.
#
# Copyright (C) 2018 Research Group Biomedical Physics,
# Max-Planck-Institute for Dynamics and Self-Organization Göttingen
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# ** end header
#
#start and stop logging; get current logs
.
.config
# load useful stuff - scans the parameters and so on...
.
patches/utils/patch_header.sh
function
set_logging
{
echo
"Setting logging
$1
..."
echo
"SET GLOBAL log_output = 'TABLE'; SET GLOBAL general_log = '
$1
';"
|
\
$MYSQL_CMD
$MYSQL_CONNECTION
--batch
success
}
case
$1
in
"start"
)
set_logging
"on"
;;
"stop"
)
set_logging
"off"
;;
"get"
)
get_logs
;;
*
)
echo
"Unknown argument:
$1
"
;
exit
1
esac
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