Script should keep checking for availability of files.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script should keep checking for availability of files.
# 1  
Old 11-30-2010
Script should keep checking for availability of files.

Hi,

I want my script to check for availability of few files contineously for some time.
Lets say from 10:00 AM to 10:30 AM script should keep checking on a particular location for each file one by one. If all the files are available then only it should complete the next processing part, else it should keep checking for the availability of the file. and after 10.30 AM the script should run completely as all files are available and if still file is not available by 10.30 then log error in logfile, but script should run by this time as it crossed the threshold 10.30.
If files available at 10.10 AM then script should run complete by the same time and no need to wait till 10.30.

thanks
Amit
# 2  
Old 12-01-2010
How do we know all files are there? Example please
# 3  
Old 12-01-2010
Hello Jim,

First of all thanks that finally you have replied to my post.
Now coming to my issue:

Lets say there are two server X1 and X2
1. server X1 has to login to server X2 through script. --- I know how to do this.
2. After reaching (cd /ab/bc/cd) to a specific path on X2 server, script has to search for specific files (say file1, file2, file3, file4 and file 5) --- I know how to do this.
3. My script which is placed on X1 is running through crontab at 10.00 AM. Now, if the files of current date is available on X2 server path, then my script will pick those and copy on server X1.
3.1 But in case, files of current date on server X2 are not avaialbe at 10.00 then my script will fail to pick the files from X2.
3.2 HERE IS MY REQUIREMENT: I want my script to check on server X2 for the availability of current date's files from schedule time 10.00 to 10.30 AM in every 5 minutes, if the files of current date is not avaialble on X2.
3.3 Anytime between 10.00 to 10.30 if files are arrived on X2, then my script should pick those and copy on X1. This should happen for all files (file1, file2, file3, file4 and file 5) on server X2.
3.4 BUT incase, if file never arrives until 10.30, then script should comeout of loop and fails it with an log entry "Waited for the files for 30 mins but bow is not avaialble.

HOPE above would help.

Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Files availability with count in email

Hi all, we have a requirement , we need to check the files availability in the unix folder and their record counts need to be emailed as attached format Files Count File_1 123 File_2 1898 File_3 29 File_4 456 File_5 123 (2 Replies)
Discussion started by: KK230689
2 Replies

2. Shell Programming and Scripting

Script to keep checking the directory for files.

Hello Folks, Looking for a script which can keep doing ls to the directories and once file landed to the directory then ,read the files do further calculation and exit. Kindly guide. Regards, Sadique (3 Replies)
Discussion started by: sadique.manzar
3 Replies

3. Shell Programming and Scripting

Checking SQL DB Availability

Hello everybody. I have a little question. Im creating a script for checking the status of different servers, and everything is running fine except for one thing. I have to check if certain DBs are connectables, I dont care anything else, nor running querys nor updating tables, the only thing I... (4 Replies)
Discussion started by: SeaSoul
4 Replies

4. Shell Programming and Scripting

Script for checking files for last hour and send a mail

Hello, I need to write a script to check the files in one folder , if that folder doesn't have files generated from last 1 hr then we need to send mail to particular persons. So Can you please help me to write script to check the files and send email. Thank you.. (1 Reply)
Discussion started by: archana23
1 Replies

5. UNIX for Dummies Questions & Answers

Script for checking the files in a folder

Hi , I am using the below script for checking for a file in a folder. if ; then echo 0 else echo 1 fi Is there any way we can check for files which are starting with GL*.csv.What I am trying to do is , I have to check in a folder for the GL*.csv files if there are any files they I... (6 Replies)
Discussion started by: wangkc
6 Replies

6. Shell Programming and Scripting

Checking availability of service

HI CAN ANY ONE HELP ME FOR BELOW QUESTION CHECKING AVAILABILITY OF SERVICE IN LINUX (2 Replies)
Discussion started by: satheeshkr_cse
2 Replies

7. Shell Programming and Scripting

Checking Files with a Shell Script

Hey everyone, I'm writing a shell script that needs to loop thru a directory and check a defined type of files(.df). I use "checkfile.x" which is a compiled program to check those files. Sintaxis : checkfile.x DatefileName.df The program displays something like this: File: kanswer.df -... (1 Reply)
Discussion started by: Testing_Yorsh
1 Replies

8. Shell Programming and Scripting

Checking availability of Web pages through Unix script

Hi Guru's, I need to check the availability of a web page for every one hour through a script. Following is the requirement. 1. Go to http://vsn.srivsn.com 2. If any error encountered in openeing the home page, it should trigger an email with the appropriate error message. 3. If page opens... (6 Replies)
Discussion started by: srivsn
6 Replies

9. Shell Programming and Scripting

Checking for availability of remote server

Hi. In my KSH script I'm running a command on a remote server. I want to know how I can test to see if the remote server is available (accessible) prior to running the command. Any ideas? My command looks like: `ssh $USER@$TARGET_SERVER_DNS ls -l $REMOTE_FOLDER ` This check should be... (4 Replies)
Discussion started by: dylanmilks
4 Replies

10. IP Networking

Checking for availability of remote server

Hi. In my KSH script I'm running a command on a remote server. I want to know how I can test to see if the remote server is available (accessible) prior to running the command. Any ideas? My command looks like: `ssh $USER@$TARGET_SERVER_DNS ls -l $REMOTE_FOLDER ` This check should be... (1 Reply)
Discussion started by: dylanmilks
1 Replies
Login or Register to Ask a Question