Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
perun-proxy-utils
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
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
Perun
Perun ProxyIdP
perun-proxy-utils
Commits
31456a7b
Unverified
Commit
31456a7b
authored
5 years ago
by
Pavel Vyskočil
Browse files
Options
Downloads
Patches
Plain Diff
Added script for db backup
parent
a513a263
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+4
-1
4 additions, 1 deletion
README.md
backup_database.sh
+18
-0
18 additions, 0 deletions
backup_database.sh
with
22 additions
and
1 deletion
README.md
+
4
−
1
View file @
31456a7b
...
@@ -8,4 +8,7 @@ All nagios scripts are located under `nagios` directory.
...
@@ -8,4 +8,7 @@ All nagios scripts are located under `nagios` directory.
*
Script for remove all logs from test accounts from SimpleSAMLlogs
*
Script for remove all logs from test accounts from SimpleSAMLlogs
*
Params:
*
Params:
*
1 - The file name
*
1 - The file name
\ No newline at end of file
### backup_database.sh
*
Do mysqldump into
`/opt/mariadb_backup`
and remove all dump file older than 7 days
\ No newline at end of file
This diff is collapsed.
Click to expand it.
backup_database.sh
0 → 100755
+
18
−
0
View file @
31456a7b
#!/bin/bash
BACKUP_FOLDER
=
"/opt/mariadb_backup"
# Ensure that backup folder exist
if
[[
!
-d
${
BACKUP_FOLDER
}
]]
;
then
mkdir
${
BACKUP_FOLDER
}
fi
BACKUP_FILE_NAME
=
${
BACKUP_FOLDER
}
/backup_
$(
date
-u
+
'%Y-%m-%d_%HH:%MM'
)
.sql
# Backup all databases
mysqldump
--all-databases
>
${
BACKUP_FILE_NAME
}
echo
"Database was dumped into
${
BACKUP_FILE_NAME
}
"
#Remove old backups > 7days
find
${
BACKUP_FOLDER
}
-name
"backup_*.sql"
-type
f
-mtime
+7
-delete
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