-
Notifications
You must be signed in to change notification settings - Fork 0
Scripts For backup #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
vsellier
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This should be placed on a
backupdirectory, not directly undersrv/bin - The elasticsearch directory backup is missing
srv/exo/bin/_setenv.sh
Outdated
| EXO_MONGO_SERVER=${MONGO_SERVER} | ||
| EXO_USER=exo | ||
| #Database Backup | ||
| DB_DUMP_WORKING_DIR=/srv/backup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should not work directly on the final backup directory because you will erase the previous backup at the beginning. If several services are on the same server the last backuped service will erase the other service backup
srv/exo/bin/_stopElasticSearch.sh
Outdated
| ACTION=stop | ||
| sudo systemctl ${ACTION} elasticsearch | ||
| else | ||
| echo "[WARN] $(display_date) ElasticSearch not deployed. Cannot be stopped !!!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should stop here
| pgrep -U $(id -u) soffice | xargs kill -9 | ||
| fi | ||
| else | ||
| echo "[WARN] ${PLF_NAME} not deployed. Cannot be stopped !!!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should stop here
Co-Authored-By: bourasom <omar.bouras@exoplatform.com>
Co-Authored-By: bourasom <omar.bouras@exoplatform.com>
Co-Authored-By: bourasom <omar.bouras@exoplatform.com>
Co-Authored-By: bourasom <omar.bouras@exoplatform.com>
vsellier
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- You should centralize the systemd services start and stop in a generic management script to have the same controls (service declaration, command and service status) for all of them
| @@ -0,0 +1,20 @@ | |||
| #!/bin/bash -eu | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be name _startDatabase.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
|
||
| display_time mongodump -o ${BACKUP_WORKING_DIR}/tmp_mongo --db=${EXO_CHAT_MONGODB_NAME} | ||
| #display_time sudo chown -R exo:exo ${BACKUP_WORKING_DIR}/tmp_mongo | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should create an tar of the backuped data and cleanup the wordking dir after
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Done |
- centralize the service detection on _functions.sh - Remove an unnecessary variable containing the action - Don't stop anymore tomcat if an error is detected during the startup - Rename _*PLF.sh _*eXo.sh
- ensure we go back to the initial directory at the end - ensure the backup is made from the n-1 level and don't assume the data dir is name data
- use elasticsearch instead of elastic - respect the full path for the backup
- Rename database name paramter - Rename finale dump to respect usual template
No description provided.