Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Script to check for a file, check for 2hrs. then quit Post 83532 by RTM on Thursday 15th of September 2005 03:52:15 PM
Old 09-15-2005
Code:
#!/bin/csh -f
set now = 0
# set up any other variables
#
#================================
loop:
if (! -e "/tmp/myfile") then
 sleep 120 # wait 2 minutes
 @ now = $now +2
  if ($now > 120) goto files-missing # Waited two hours - giving up
  goto loop
endif
# Put what to do if you found the file here
# and then go to the end to exit
goto end-it-all
#===================
files-missing:
# You might want to send yourself an email that it didn't get the file
# or just drop through to end-it-all
end-it-all:
exit

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to check file sequence

Hi everyone, I need help in creating a script that would check if the file sequence is in order in a particular directory. These are log files that are generated throughout the day. Example of the file name will be, ABC01_YYMMDDHHMM###### (ABC01_0904161829000001) Sometimes the file... (4 Replies)
Discussion started by: kumaran21
4 Replies

2. Shell Programming and Scripting

File check script

Hi, This script may be basic for expert, How to monitor files on a special folder (ls -rtla) and output the result to a file with timestamp name ? I'll schedule the script with Cron. Thanks, Fabien (5 Replies)
Discussion started by: unclefab
5 Replies

3. Shell Programming and Scripting

Script to check if file exists

guys, I am trying to write a script that does the following: it looks for a file in a specific directory and if the file is not there (NOT), it emails me. I have tried the following but its not working. It simply hangs up. Please help. if then mail -s 'blah blah blah' my email... (4 Replies)
Discussion started by: basisvasis
4 Replies

4. Shell Programming and Scripting

script to check if another script is running and if so, then sleep for sometime and check again

Hi, I am a unix newbie. I need to write a script to check wheteher another script is still running. If it is, then sleep for 30m and then check again if the script is running. If the script has stopped running then, I need to come out of the loop. I am using RHEL 5.2 (2 Replies)
Discussion started by: mathews
2 Replies

5. UNIX for Advanced & Expert Users

Check EOF char in Unix. OR To check file has been received completely from a remote system

Advance Thanks. (1) I would like to know any unix/Linux command to check EOF char in a file. (2) Or Any way I can check a file has been reached completely at machine B from machine A. Note that machine A ftp/scp the file to machine B at unknown time. (5 Replies)
Discussion started by: alexalex1
5 Replies

6. Shell Programming and Scripting

How to check file permissions from a script.

hello, I have to write a script to run the other script inside it.So iam planning to write like this? first check the perimissions of the file. Alogorthim ---------- if(!filepermissions == execute) then echo" Permissions denined" else execute the script. file name is : load_mf.sh... (1 Reply)
Discussion started by: rajkumar_g
1 Replies

7. UNIX for Advanced & Expert Users

script to check if file was downloaded

I want to create a script to check if a file was downloaded into a folder. if it was i dont want to re-download it. The requirement is as follows. The first time the file (filename: A) is downloaded, it is renamed by stripping off part of the filename to filename A22. The second time an... (1 Reply)
Discussion started by: wizardofoz
1 Replies

8. Shell Programming and Scripting

Script to check file exists

Hi, I am trying to write a script which checks if any file exists with "*.log" or "*.out" in Directory below is the code #------------------ path=/abd/xyz/ if ; then echo "Good" else echo "Failure" fi #-------------------------- its always going to else part and printing... (8 Replies)
Discussion started by: ch33ry
8 Replies

9. Shell Programming and Scripting

check file script

hi, i have a small file with 4 rows that looks like this: any_error_today= any_message_today= any_other_thing= any_other _thing= I want to write a script that checks if after any = there is no data(is empty), then everything is OK. If after = there is data written, for example... (6 Replies)
Discussion started by: arrals_vl
6 Replies

10. Shell Programming and Scripting

Script to check if file is placed

Hello, I am currently looking how to develop a script to monitor files placed in a particular folder. This is not actually a big deal as I usually do some perl and shell scripting, but my problem goes here: First, the folder names in which these files are being placed uses a naming convention of... (1 Reply)
Discussion started by: Wizard_1979
1 Replies
FILECAP:(8)						  System Administration Utilities					       FILECAP:(8)

NAME
filecap - a program to see capabilities SYNOPSIS
filecap [ -a | -d | /dir | /dir/file [cap1 cap2 ...] ] DESCRIPTION
filecap is a program that prints out a report of programs with file based capabilities. If a file is not in the report or there is no report at all, no capabilities were found. For expedience, the default is to check only the directories in the PATH environmental variable. If the -a command line option is given, then all directories will be checked. If a directory is passed, it will recursively check that directory. If a path to a file is given, it will only check that file. If the path to the file includes capabilities, then they are written to the file. OPTIONS
-a This tells the program to show all capabilities starting from the / directory. Normally the PATH environmental variable is used to show you capabilities on files you are likely to execute. -d This dumps all capabilities for reference. EXAMPLES
To check file capabilities in $PATH: filecap To check file capabilities of whole system: filecap -a To check file capabilities recursively in a directory: filecap /usr To check file capabilities of a specific program: filecap /bin/passwd To list all possible capabilities: filecap -d To set a file capability on a specific program: filecap /bin/ping net_raw net_admin SEE ALSO
pscap(8), netcap(8), capabilities(7). AUTHOR
Steve Grubb Red Hat March 2009 FILECAP:(8)
All times are GMT -4. The time now is 03:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy