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

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?

~$ date
Wed Aug 16 20:11:38 EDT 2006
#!/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

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

What is the criteria to select 2 files?

Regards,
Tayyab

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

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!

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