metacat/src/scripts/bash/restore_knb.sh @ 10298
1 | 9140 | tao | #!/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` |