Server maintenance - seqcode/pegr GitHub Wiki
$ sudo reboot
Since it's always good to reboot the system after patching, coordinate a data and time beforehand.
$ sudo def update
$ sudo systemctl restart pegr
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
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.
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
Check /path/to/sync.log for logs.
mysql -u <DB_USER> -p<DB_PASSWD> <DB_NAME> < pegr_sync.sql
See details here.