Subversion Repositories SmartDukaan

Rev

Rev 6724 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6724 rajveer 1
#!/bin/bash
2
# resolve links - $0 may be a softlink
3
PRG="$0"
4
 
5
while [ -h "$PRG" ]; do
6
  ls=`ls -ld "$PRG"`
7
  link=`expr "$ls" : '.*-> \(.*\)$'`
8
  if expr "$link" : '/.*' > /dev/null; then
9
    PRG="$link"
10
  else
11
    PRG=`dirname "$PRG"`/"$link"
12
  fi
13
done
14
 
15
# Get standard environment variables
16
PRGDIR=`dirname $(readlink -f "$PRG")`
17
PYTHON_DIR="/usr/local/lib/python2.6/dist-packages/PyProj-0.1-py2.6.egg"
18
DATE=`date +%Y-%b-%d`
19
 
20
#Email the two report files.
21
 
22
FROM='cnc.center@shop2020.in'
23
PASSWD='5h0p2o2o'
24
 
25
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"
26
 
27
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}.tsv
28
 
11839 amit.gupta 29
python ${PYTHON_DIR}/shop2020/utils/EmailAttachmentSender.py -f ${FROM} -p ${PASSWD} -t sandeep.sachdeva@shop2020.in -t khushal.bhatia@shop2020.in -t anikendra.das@shop2020.in amit.gupta@shop2020.in -s "Additional Inventory in Hotspot warehouses" -a /tmp/NegativeInventory.${DATE}.tsv
6724 rajveer 30
 
31
rm /tmp/NegativeInventory.${DATE}.tsv