Revision 8933
Added by Jing Tao about 10 years ago
restore-dumped-data-to-pg9.3.sh | ||
---|---|---|
34 | 34 |
fi |
35 | 35 |
METACAT_BACKUP_FILE_NAME=$1 |
36 | 36 |
echo "the backup file name is $METACAT_BACKUP_FILE_NAME" |
37 |
|
|
38 |
if [ -f $METACAT_BACKUP_DIR/$METACAT_BACKUP_FILE_NAME ]; then |
|
39 |
echo "the metacat backup file $METACAT_BACKUP_DIR/$METACAT_BACKUP_FILE_NAME exists."; |
|
40 |
else |
|
41 |
echo "the metacat backup file $METACAT_BACKUP_DIR/$METACAT_BACKUP_FILE_NAME doesn't exist, please double check the name."; |
|
42 |
exit 1; |
|
43 |
fi |
|
44 |
|
|
37 | 45 |
DECOMPRESS_DIR_NAME=${METACAT_BACKUP_FILE_NAME%%.*} |
38 | 46 |
echo "the decmporessed dir is $DECOMPRESS_DIR_NAME" |
39 | 47 |
|
... | ... | |
77 | 85 |
su - postgres -c "/usr/lib/postgresql/$NEW_DB_VERSION/bin/vacuumdb --all" |
78 | 86 |
echo "end to vacuum the db at " |
79 | 87 |
echo `date` |
80 |
|
|
88 |
exit 0 |
Also available in: Unified diff
Added the code to check if the metacat backup file exists.
Added the code "exist 0" at the end of the scripts.