Watch for File on Windows share using Shell Script
I want to poll a particular file on a Windows shared drive using shell script and copy it to a Unix directory if present.
Step wise execution:
1) Poll/watch for a file in the following location on Windows share:
(SRC_DIR=\\mum\dharmesh\research\ST_DXR_20080821 to DXR.xls)
2) If present, copy(FTP would be a suitable option) it to Unix directory
(DEST_DIR=/home/dharmesh/DXRFiles)
after renaming it.
I have figured out how to FTP and rename it, using the following piece of code:-
ftp -iv <hostname> << EOF
bin
cd "$SRC_DIR"
lcd "$DEST_DIR"
get "ST_DXR_20080821 to DXR.xls" "ST_DXR_20080821.xls"
close
bye
EOF
The real problem lies in Step 1.
Any suggestions/help needed.
Thanks,
dV
|