Project

General

Profile

« Previous | Next » 

Revision 9140

Added by Jing Tao almost 10 years ago

Add a script file to restore knb db from a dumped file.

View differences:

src/scripts/bash/restore_knb.sh
1
#!/bin/sh
2
DB_NAME=knb
3
DUMP_FILE=/var/lib/postgresql/knb_dump
4
THREAD_NUM=4
5
echo "start to restore database by $THREAD_NUM threads at"
6
echo `date`
7
#sudo su - postgres -c "dropdb $DB_NAME"
8
#sudo su - postgres -c "createdb $DB_NAME"
9
sudo su - postgres -c "pg_restore -j $THREAD_NUM -d $DB_NAME $DUMP_FILE"
10
echo "end to restore database by $THREAD_NUM threads at"
11
echo `date`

Also available in: Unified diff