Server maintenance - seqcode/pegr GitHub Wiki

How to reboot the server

$ sudo reboot

How to patch the system

Since it's always good to reboot the system after patching, coordinate a data and time beforehand.

$ sudo def update

How to start pegr

$ sudo systemctl restart pegr

How to check that all systems came back online

Go to pegr website, and check if everything is fine. On the server, you can check individual services including pegr, httpd and mariadb.

$ sudo systemctl status pegr

$ sudo systemctl status https

$ sudo systemctl status mariadb

How is pegr.service configured?

See the Section 8 here. Once the pegr service is set up, it should start automatically on server reboot. Further, you can run systemctl commands to start, stop or check the status of pegr service.

Where does the automatic database backup go? When does it activate?

Create a shell script to backup the database and files to a remote server.

# generate a database dump
mysqldump -u <DB_USER> -p<DB_PASSWD> <DB_NAME>  > /PATH/TO/pegr_sync.sql

# sync the database dump to remote server
rsync -avzhe 'ssh' /PAHT/TO/pegr_sync.sql <USER>@<REMOTE_SERVER>:/PATH/TO/pegr_sync.sql

# import the database dump to the remote server's database
ssh <USER>@<REMOTE_SERVER> 'mysql -u <DB_USER> -p<DB_PASSWD> <DB_NAME> < pegr_sync.sql'

# sync the files
rsync -avz /usr/local/pegr/files/ <USER>@<REMOTE_SERVER>:/usr/local/pegr/files

Set up a cron job to run the shell script, e..g every day at 1:05 am.

5 1 * * * bash /path/to/sync.sh >> /path/to/sync.log 2>&1

How to check the auto-sync between production and dev

Check /path/to/sync.log for logs.

How to restore PEGR using database backup

mysql -u <DB_USER> -p<DB_PASSWD> <DB_NAME> < pegr_sync.sql

Where is CILogon configuration details located?

See details here.

⚠️ **GitHub.com Fallback** ⚠️