add logs command to orientdb script
@@ -13,7 +13,7 @@ ORIENTDB_USER="USER_YOU_WANT_ORIENTDB_RUN_WITH"
LOG_DIR="../log"
usage() {
- echo "Usage: `basename $0`: <start|stop|status>"
+ echo "Usage: `basename $0`: <start|stop|logs|status>"
exit 1
}
@@ -41,6 +41,11 @@ stop() {
su $ORIENTDB_USER -c "cd \"$ORIENTDB_DIR/bin\"; /usr/bin/nohup ./shutdown.sh 1>>$LOG_DIR/orientdb.log 2>>$LOG_DIR/orientdb.err &"
}
+logs() {
+ echo "Tailing OrientDB server logs, press Ctrl+C to stop."
+ tail -qF -n0 $LOG_DIR/orientdb.err $LOG_DIR/orientdb.log
+}
+
status() {
PID=` ps auxw | grep 'orientdb.www.path' | grep java | grep -v grep | awk '{print $2}'`
if [ "x$PID" = "x" ]
@@ -64,6 +69,12 @@ then
exit 0
fi
+if [ "x$1" = "xlogs" ]
+then
+ logs
+ exit 0
+fi
+
if [ "x$1" = "xstatus" ]
then
status
