09-15-2005
Script to check for a file, check for 2hrs. then quit
I wish to seach a Dir for a specific file, once the file is found i will perform additional logic. If the file is not found within two hours, i would like to exit.
Logically, I'm looking for the best way to approach this
Thanks for any assistance in advance.
Note: I'm using a C shell and have a little exp with awk,sed and grep.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
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
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
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
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
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
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
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
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
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
LEARN ABOUT DEBIAN
dir::self
Dir::Self(3pm) User Contributed Perl Documentation Dir::Self(3pm)
NAME
Dir::Self - a __DIR__ constant for the directory your source file is in
SYNOPSIS
use Dir::Self;
use lib __DIR__ . "/lib";
my $conffile = __DIR__ . "/config";
DESCRIPTION
Perl has two pseudo-constants describing the current location in your source code, "__FILE__" and "__LINE__". This module adds "__DIR__",
which expands to the directory your source file is in, as an absolute pathname.
This is useful if your code wants to access files in the same directory, like helper modules or configuration data. This is a bit like
FindBin except it's not limited to the main program, i.e. you can also use it in modules. And it actually works.
As of version 0.10 each use of "__DIR__" recomputes the directory name; this ensures that files in different directories that share the
same package name get correct results. If you don't want this, "use Dir::Self qw(:static)" will create a true "__DIR__" constant in your
package that contains the directory name at the point of "use".
AUTHOR
Lukas Mai <l.mai @web.de>
COPYRIGHT AND LICENSE
Copyright (C) 2007, 2008 by Lukas Mai
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or,
at your option, any later version of Perl 5 you may have available.
perl v5.10.1 2008-05-11 Dir::Self(3pm)