# getallinvpdf # gets invoice PDF files from Windows File share. #Copyright(C) 2002-2013 Trans-Mit Pty. Ltd. Melbourne Australia #This software may not be loaned, resold, changed or copied #in any way without the express written permission of author #and Trans-Mit Pty. Ltd., Australia. BILLPERIOD="$1" #(MMM_YYYY) invpdfdir="$2" pdfshare="//S-VM-SQL06/tasdata" userid="vrt_svc_telmax" passwd="Z-dM-9o}s" # eg. above share should have the files /TBIMSInvoices/YYYYMM/INV*.pdf # (or /TBIMSInvoices/YYYY//YYYYMM/INV*.pdf for old years) # with the following file format... # INV003489_MTS_DEPARTMENT_20100608_133341.pdf A 34676 Tue Jun 8 13:33:42 2010 # INV003509_DCC_DEPARTMENT_20100609_170908.pdf A 34612 Wed Jun 9 17:09:09 2010 if [ "$invpdfdir" = "" ]; then invpdfdir="indata/$BILLPERIOD/invpdf"; fi if [ "$YYYY" = "$curYYYY" ]; then invfolder="/TBIMSInvoices/$YYYYMM" else invfolder="/TBIMSInvoices/$YYYY/$YYYYMM" fi # get pdf files ( cd "$invpdfdir" smbcmd="cd $invfolder/; prompt; mget *.pdf" smbclient ${pdfshare} -U${userid}%${passwd} -E -c "$smbcmd" 2>>"$logfile" )