Fetching file from windows server


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Fetching file from windows server
# 1  
Old 08-16-2006
Fetching file from windows server

hi
i am having 2 servers.... one having windows & the other one is having Solaris on it. Now i need to fetch files from windows server and copy them on to solaris server.
the problem is that a new folder is created after every one hour in the window server and i have to fetch 2 files from this newly created server.
so in windows server i am havin 7 folders---- one each for a day of week....
every folder is having 24 sub folder created one by one as the hours of the day pass on...
each sub folder i.e. folder created after an hour has 8 files and i need to fetch only 2 files.

so i am unable to automate it coz. i have to specify new path every time i have to fetch a file....

for example...
day SUNDAY hour 10th path is
cd /KR/SUNDAY/HOUR10/
for 11th hour
cd /KR/SUNDAY/HOUR11/

for MONDAY hour 1st
cd /KR/MONDAY/HOUR1/
for 2nd hour
cd /KR/MONDAY/HOUR2/

Please help....

Regards
Rochit
# 2  
Old 08-16-2006
Not sure if I understand exactly what you're trying to do, but it seems like you could do something in a script and set up cron?

Code:
~$ date
Wed Aug 16 20:11:38 EDT 2006

Code:
#!/bin/ksh
# Ex: dir=/KR/WEDNESDAY/HOUR20
dir=/KR/`date "+%A"|tr '[a-z]' '[A-Z]'`/HOUR`date "+%H"`
dir=`echo $dir|tr -d ' '|sed s/HOUR0/HOUR/g`
cp ${dir}/file1 /somewhere
cp ${dir}/file2 /somewhere

I'm sure there's a better way to do this, but this was the first thing that came to mind..
- John
# 3  
Old 08-17-2006
I think he needs to write a script in DOS rather than Solaris machine which will put selected files thru FTP to the Solaris server.

One other way could be using Samba.

But your question is not clear, what I understand is that you have 7 folders one for each day of week and 24 sub-folders for each hour of day but ambiguity is here
Quote:
folder created after an hour has 8 files and i need to fetch only 2 files
What is the criteria to select 2 files?

Regards,
Tayyab
# 4  
Old 08-17-2006
hi shereenmotor

thanks for showing your concern...
forget the name of files in folder.... because there are standard names for files, that does not vary from folder.. i.e. every folder has files with same name.... thats not the problem ...
the problem is how to specify a different location name after every hour...
i think ur suggestion of using a DOS script is good idea, but i don't know dos scripting.. could u help me please..

Regards
Rochit
# 5  
Old 08-19-2006
Still your answer is not clear, but if you are interested in DOS batch programming, spare few minutes for this DOS tutorial, it can give you a good start: http://www.allenware.com/icsw/icswidx.htm

Best of luck!
# 6  
Old 08-19-2006
hi
what i need is to have a script on DOS/UNIX, that can fetch files from windos server & copy them on to Unix server.
The only problem is that i have to access a different folder for fetching files.

say for eg... if today is monday then i'll be fetching files from 24 folders. after every hour a folder is accessed corresponding to the hour that has passed...
for first hour cd /KR/MONDAY/hour0 have to fetch folder hour0
for second hour cd /KR/MONDAY/hour1 have to fetch folder hour1
for third hour cd /KR/MONDAY/hour2 have to fetch folder hour2
....................
.....................
...................

for 24th hour cd /KR/MONDAY/hour23 have to fetch folder hour23

for tuesday
for first hour cd /KR/TUESDAY/hour0 have to fetch folder hour0
for second hour cd /KR/TUESDAY/hour1 have to fetch folder hour1
for third hour cd /KR/TUESDAY/hour2 have to fetch folder hour2
....................
.....................
...................

for 24th hour cd /KR/TUESDAY/hour23 have to fetch folder hour23

and in this way i have to fetch files all 7 days..

Regards
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

KSH fetching files from server A onto server B and putting on server C

Dear Friends, Sorry for this basic request. But I just started learning Ksh recently and still I am a newbie in this field. Q: I have files on one server and the date format is 20121001000009_224625.in which has year (yyyy) month (mm) and date (dd). I have these files on server A. The task... (8 Replies)
Discussion started by: BrownBob
8 Replies

2. Windows & DOS: Issues & Discussions

Get file on our windows desktop from a ubuntu server

Hello, How can I please have a program automatically upload some files from a ubuntu server to my machine desktop that is running windows XP? I would like to be able to do that from the windows machine itself. Thanks, (3 Replies)
Discussion started by: Pouchie1
3 Replies

3. Shell Programming and Scripting

Need help for ftp a file from unix to windows server

I have a problem with ftp. i want to ftp a file "file.txt" from unix box to windows server. The destination folder is something like this: "\\windowsservername\apps\is\" FTPUSER=ftp1 FTPPASS=**** ftp -v -d -n > ftplog <<!EOF open windowsservername user $FTPUSER $FTPASS cd... (3 Replies)
Discussion started by: Diddy
3 Replies

4. Shell Programming and Scripting

Unix shell script to Copy files from one Windows server to another Windows server.

Can anybody please help me on how to code for the below requirement: I need to write a shell script (on different unix server) to copy files from multiple folders (ex. BRN-000001) from one windows server (\\boldls-mwe-dev4)to a different windows server(\\rrwin-ewhd04.ecomad.int). This shell... (4 Replies)
Discussion started by: SravsJaya
4 Replies

5. Shell Programming and Scripting

Perl: Sending file from UNIX server to Windows server

I'm trying to write a Perl script where a file from a UNIX server box connects to a Windows server box and copies that file into the Window box. The main problem I have right now is that whenever I try to connect to the Windows box, the connection is refused. The error message that always pops... (2 Replies)
Discussion started by: kooshi
2 Replies

6. UNIX for Dummies Questions & Answers

Copy a windows CVS file to the unix server as a svs file

I so desperately need a script to copy a windows csv file to my unix server and i know these should be at dummies but i have no bits. it is life & no job situation help please. thanks (1 Reply)
Discussion started by: zhegal
1 Replies

7. Shell Programming and Scripting

Transferring file from Windows server...

Hi, I want to transfer html files from windows server to unix server. Those files also have to be assigned proper permissions. Can u people suggest any ideas for this scenario? Regards, http://www.unix.com/images/smilies/thumb.gifSanthosh (1 Reply)
Discussion started by: Santhosh_Ind
1 Replies

8. Shell Programming and Scripting

Logs access in windows fetching the data from a unix server

How I can get the logs that are getting stored in specific location in unix server through an Apache web server installed in unix server? Requirement is to access the logs through the URL in windows browser without any access. (1 Reply)
Discussion started by: alvida
1 Replies

9. HP-UX

File transfer between unix and windows server

hi all, I have two server(Unix tru64 and windows 2003 server). these server's live running now. The win2003server doesn't have ftp server. Also Unix server doesn't have samba. if both server's have ftp server that no problem. How to transfer file from windows server to unix by every... (2 Replies)
Discussion started by: Tlg13team
2 Replies

10. Programming

retrieve file from windows server

I am working with tcl in an unix server. Is it possible to retrieve a file from windows to unix without "ftp"ing. I have tried ftp and only to an dead end (1 Reply)
Discussion started by: damn_bkb
1 Replies
Login or Register to Ask a Question