Sponsored Content
Top Forums Shell Programming and Scripting Script check for file, alert if not there, and continue checking until file arrives Post 302454982 by markdjones82 on Monday 20th of September 2010 12:45:46 PM
Old 09-20-2010
Script check for file, alert if not there, and continue checking until file arrives

All,
Is there a way to keep checking for a file over and over again in the same script for an interval of time?

Ie

If [no file] {
mail -user
continue checking until file arrives
file arrives
tasks
exit

I don't want the script to run each time and email the user each time a file isn't there. So, I want it to continue checking the file until it arrives and only exit when the file shows up.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

reading a file name as soon as that files arrives into a folder

Hi, Thanks in Advance.. i have the following requirement, some one please help me.. An unix shell script has to pick up the file name from a folder as soon as that file comes into that folder. Regards, Alo (6 Replies)
Discussion started by: dtazv
6 Replies

2. Shell Programming and Scripting

Continue Script when File Found

Hello All, I am trying to write a script that will only continue executing my script if a file exits. I know the directory of the file, so its just a matter of seeing if the file exists yet. If the file has not yet been created, I want the script to wait 10 minutes (600 seconds) and try again.... (7 Replies)
Discussion started by: Jose Miguel
7 Replies

3. Shell Programming and Scripting

Have a shell script check for a file to exist before processing another file

I have a shell script that runs all the time looking for a certain type of file and then it processes the file through a series of other scripts. The script is watching a directory that has files uploaded to it via SFTP. It already checks the size of the file to make sure that it is not still... (3 Replies)
Discussion started by: heprox
3 Replies

4. Shell Programming and Scripting

Check File Exists and compare to previous day file script

We have data files that are ftp'd every morning to a SUN server. The file names are exactly the same except for that each has the date included in its name. I have to write script to do 2 things: STEP 1) Verify that the file arrived in morning. STEP 2) Compare the file size of the current... (3 Replies)
Discussion started by: rbknisely
3 Replies

5. Shell Programming and Scripting

Script to check for the file existence, if file exists it should echo the no of modified days

Hi, I am looking for a shell script with the following. 1. It should check whether a particular file exists in a location #!/bin/sh if ; then echo "xxx.txt File Exists" else echo "File Not Found" fi 2. If file exists, it should check for the modified date and run a command... (2 Replies)
Discussion started by: karthikeyan_mac
2 Replies

6. Shell Programming and Scripting

File checking script need help

Hi, Gurus, I need a scripts to check specified file if it exists or not at certain time (say every month between 5th and 7th). if file exists do something otherwise do another thing. can anybody help this? Thanks in advance :wall: (3 Replies)
Discussion started by: ken002
3 Replies

7. Shell Programming and Scripting

Check if file exists if not send an alert

Hi, Im looking to write a script to check if a file exists and if it doesnt then send an email out, Ive found the below code but I don't understand the ! in the if statement can anyone explain? Any help will be much appreciated #!/bin/bash if then echo "File not exists" |... (10 Replies)
Discussion started by: 02JayJay02
10 Replies

8. Shell Programming and Scripting

Check log file size every 10 minute. Alert if log not update

How to check log size every 10min. by script (can use crontab) if log size not change with alert "Log not update" Base run on SunOS 5.8 Generic_Virtual sun4u sparc SUNW,SPARC-Enterprise logFiles="log1.log log2.log" logLocation="/usr/home/test/log/" Out put. Tue Jan 31... (3 Replies)
Discussion started by: ooilinlove
3 Replies

9. Shell Programming and Scripting

Shell script to read file and check file type

Hi, I have a file with few values in it. I need script help to read file line by line and check: 1/if it's a file (with extension eg .java .css .jar etc ) or 2/if it's a file without extension and treat it as a directory and then check if the directory exists in working copy else create one... (6 Replies)
Discussion started by: iaav
6 Replies

10. Shell Programming and Scripting

Script fro file check and load the trail file

Hi, Im going to use shell script for load the data into DB. First i need to read the trail file(csv file has two columns with comma separated ) like file name trail1024(last 4 digitsMMDD). In this trail file 27 entries will have like below,I need to read first csv file name and get the 4... (1 Reply)
Discussion started by: krajasekhar.v
1 Replies
away(1) 							   User Manuals 							   away(1)

NAME
away - terminal locking program SYNOPSIS
away [OPTIONS] message [...] DESCRIPTION
away is a simple program that locks your terminal, checks for new mail in any given number of mailboxes, and lets other users know why you are inactive. OPTIONS
-c, --mail Enable checking of mail. -C, --nomail Disable checking of mail. -f, --rcfile=FILE Specify an alternative configuration file instead of the default ~/.awayrc file. -F, --norcfile Ignore user configuration file. -h, --help Display help. -m, --message Execute as the remainder of the command line, effectively stripping off the executable name and additional switches. -p, --persist Continue checking for new mail as long as there is at least one mailbox that has not received new mail. -P, --nopersist Stop checking mail if any mailbox is found to have new mail. -t, --time=SECONDS Set the number of second that away sleeps before performing its background tasks. Presently, the only background task that away will perform is the checking of mailboxes. -T, --notime Ignore any options to set the time interval and use the default number of seconds. -v, --version Display version information. FILES
~/.awayrc Per user configuration file. See awayrc(5) for further details. /etc/pam.d/away The Linux-PAM configuration file. BUGS
Bug reports should be sent to the away mailing list <away@unbeatenpath.net>. SEE ALSO
awayrc(5) AUTHORS
Cameron Moore <cameron@unbeatenpath.net>, and others. Linux November 2000 away(1)
All times are GMT -4. The time now is 03:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy