| 5944 |
mandeep.dh |
1 |
#!/bin/bash
|
|
|
2 |
|
|
|
3 |
if [ $# -lt 3 ]
|
|
|
4 |
then
|
|
|
5 |
echo "Usage: $0 <Product Type> <Warehouse Id> <Report File Name>"
|
|
|
6 |
exit 1
|
|
|
7 |
fi
|
|
|
8 |
|
|
|
9 |
REPORT_DIR=/InventoryReports
|
|
|
10 |
PROD_SERVER="50.116.3.101"
|
|
|
11 |
|
|
|
12 |
REPORT_TYPE=$1
|
|
|
13 |
WAREHOUSE_ID=$2
|
|
|
14 |
REPORT_FILE=$3
|
|
|
15 |
DAY=`date -d '1 day ago' +%Y-%b-%d`
|
|
|
16 |
|
|
|
17 |
if [ "$REPORT_TYPE" = "Handsets" ]
|
|
|
18 |
then
|
|
|
19 |
scp root@${PROD_SERVER}:/InventoryReports/inventory-report-${DAY}-${WAREHOUSE_ID}.csv ${REPORT_DIR}/
|
|
|
20 |
scp root@${PROD_SERVER}:/InventoryReports/vendor-mapping-1.csv ${REPORT_DIR}/
|
|
|
21 |
./CompareInventory.py -c "${REPORT_FILE}" -i ${REPORT_DIR}/inventory-report-${DAY}-${WAREHOUSE_ID}.csv -v ${REPORT_DIR}/vendor-mapping-1.csv -p Handsets -d ${DAY}.${WAREHOUSE_ID}
|
|
|
22 |
else
|
|
|
23 |
scp root@${PROD_SERVER}:/InventoryReports/inventory-report-${DAY}-${WAREHOUSE_ID}.csv ${REPORT_DIR}/
|
|
|
24 |
scp root@${PROD_SERVER}:/InventoryReports/vendor-mapping-2.csv ${REPORT_DIR}/
|
|
|
25 |
./CompareInventory.py -c "${REPORT_FILE}" -i ${REPORT_DIR}/inventory-report-${DAY}-${WAREHOUSE_ID}.csv -v ${REPORT_DIR}/vendor-mapping-2.csv -d ${REPORT_TYPE}.${DAY}
|
|
|
26 |
fi
|