Created
March 31, 2021 14:28
-
-
Save vinayvenu/c1136a8a19457ba623116bebb7dd8825 to your computer and use it in GitHub Desktop.
Set up backup for Bahmni
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo su | |
vi /etc/systemd/system/multi-user.target.wants/openmrs.service | |
# Change user and group from bahmni to root | |
systemctl daemon-reload | |
# Unlink /var/run so that systemctl runs | |
unlink /var/run/openmrs | |
# By now, we should be able to run openmrs using systemctl | |
vi /etc/bahmni-installer/local | |
# ensure localhost is added to mysql-backup-tool and postgres-backup-tool | |
Remove incremental backup mechanisms | |
sudo rm -f /usr/bin/pgbackrest | |
sudo rm -f /usr/bin/pg_backrest | |
sudo rm -rf /usr/lib/perl5/BackRest | |
sudo rm -rf /usr/share/perl5/BackRest | |
sudo rm -rf /usr/lib/perl5/pgBackRest | |
sudo rm -rf /usr/share/perl5/pgBackRest | |
yum list installed | grep xtrabackup|xargs yum remove -y | |
Try a backup command | |
bahmni -i local backup --backup_type=db --options=clinlims | |
bahmni -i local backup --backup_type=db --options=openmrs | |
# Ensure mysql backup is available in /data and postgres backup is available in /var/lib/pgbackrest/clinlims | |
# Schedule backups for regular intervals | |
bahmni -i local backup --backup_type=db --options=openmrs --strategy=full --schedule "30 2 * * 0" | |
bahmni -i local backup --backup_type=db --options=clinlims --strategy=full --schedule "0 3 * * 0" | |
# Verify scheduling is done | |
crontab -l |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment