Project

General

Profile

« Previous | Next » 

Revision 8940

Added by Jing Tao about 10 years ago

Add the "-y" option to force removing the old postgresql without prompting a y/n question.

View differences:

src/scripts/bash/restore-dumped-data-to-pg9.3.sh
42 42
    exit 1;
43 43
fi
44 44

  
45
echo "stop postgresql"
46
/etc/init.d/postgresql stop
47

  
45 48
DECOMPRESS_DIR_NAME=${METACAT_BACKUP_FILE_NAME%%.*}
46 49
echo "the decmporessed dir is $DECOMPRESS_DIR_NAME"
47 50

  
......
54 57
	rm -rf $OLD_DB_DATA_DIR
55 58
fi
56 59

  
57
echo "stop postgresql"
58
/etc/init.d/postgresql stop
59

  
60 60
echo "remove postgresql 8.4 and 9.1"
61
apt-get remove postgresql-$OLD_DB_VERSION
62
apt-get remove postgresql-$ANOTHER_OLD_DB_VERSION
63 61

  
62
apt-get -y remove postgresql-$OLD_DB_VERSION
63
apt-get -y remove postgresql-$ANOTHER_OLD_DB_VERSION
64

  
64 65
echo "modify the port to 5432 in the new db configuration file"
65 66
sed -i.bak --regexp-extended "s/(port =).*/\1${PORT}/;" $NEW_DB_CONFIG
66 67

  

Also available in: Unified diff