![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| like to share this beautiful shell script | girish.batra | Shell Programming and Scripting | 0 | 02-29-2008 07:22 AM |
| Mac OS, Linux May Share a Windows Flaw - PC World | iBot | UNIX and Linux RSS News | 0 | 10-13-2007 01:50 PM |
| how i can share the file between unix or linux in windows ?? | msn22 | Linux | 4 | 12-07-2006 03:13 PM |
| write syslog to windows share | zuessh | AIX | 4 | 06-28-2006 05:37 AM |
| Mounting a windows share on AIX | szahir1 | Windows & DOS: Issues & Discussions | 3 | 04-11-2002 09:14 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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 |
|
||||
|
If you have Samba, you don't need ftp. If you don't have Samba, how can you monitor the share? Are you trying to find out how to see the Windows share so you can monitor it, or are you trying to figure out how to periodically monitor something which you can already see? Anyway, smbclient or an SMB / CIFS mount is probably the crucial piece of infrastructure you need in order to get going.
Code:
while true; do cp /path/to/ugly/samba/share/name/"ugly windows file name here" /path/to/unix/file_name.xls && break sleep 300 done |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|