Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
#!/bin/bash# resolve links - $0 may be a softlinkPRG="$0"while [ -h "$PRG" ]; dols=`ls -ld "$PRG"`link=`expr "$ls" : '.*-> \(.*\)$'`if expr "$link" : '/.*' > /dev/null; thenPRG="$link"elsePRG=`dirname "$PRG"`/"$link"fidone# Get standard environment variablesPRGDIR=`dirname $(readlink -f "$PRG")`PYTHON_DIR="/usr/local/lib/python2.6/dist-packages/PyProj-0.1-py2.6.egg"DATE=`date +%Y-%b-%d`#Email the two report files.FROM='cnc.center@shop2020.in'PASSWD='5h0p2o2o'mysql -uroot -pshop2020 -h 192.168.190.114 inventory -e "update currentinventorysnapshot c, warehouse w set availability = 0 where w.id = c.warehouse_id and isAvailabilityMonitored = 0 and vendor_id = 1 and availability < 0"mysql -uroot -pshop2020 -h 192.168.190.114 inventory -e "select w.displayName, c.item_id, c.availability, c.reserved from currentinventorysnapshot c, warehouse w where w.id = c.warehouse_id and isAvailabilityMonitored = 0 and vendor_id = 1 and availability > 0" > /tmp/NegativeInventory.${DATE}.tsvpython ${PYTHON_DIR}/shop2020/utils/EmailAttachmentSender.py -f ${FROM} -p ${PASSWD} -t sandeep.sachdeva@shop2020.in -t khushal.bhatia@shop2020.in -t rajveer.singh@shop2020.in -s "Additional Inventory in Hotspot warehouses" -a /tmp/NegativeInventory.${DATE}.tsvrm /tmp/NegativeInventory.${DATE}.tsv