Set the PATH_TO_BACKUP_FOLDER variable to your backup directory. By executing the following commands, a backup file named backup.xx-xx-xx_xx:xx:xx.tar.gz will be created in $PATH_TO_BACKUP_FOLDER (the script will keep the 3 most recent files):
PATH_TO_BACKUP_FOLDER=/xxx
bin/dbbackup.sh -m metadb -p $PATH_TO_BACKUP_FOLDER
PATH_TO_BACKUP_FOLDER=/xxx
bin/hengshi-sense-bin stop all
mv pg_data pg_data.old
bin/hengshi-sense-bin init metadb
bin/dbrestore.sh -m metadb -r $PATH_TO_BACKUP_FOLDER/backup.xx-xx-xx_xx:xx:xx.tar.gz