Sponsored Content
Top Forums UNIX for Advanced & Expert Users When a file is created where does unix store the info? Post 302105687 by Create on Sunday 4th of February 2007 12:00:58 AM
Old 02-04-2007
you are going about this the wrong way..

dont run a job every 2 minutes.. run one script that waits for the file...


Something like this:
Code:
TOTALTIME=0
CANCELTIME= 28800 #1 day almost

cd /whatever/location/file/is
while true
do
        if [ -f whateverfile.file ]
        then
                echo whateverfile.file file found! 
                #INSERT WHATEVER YOU WANT TO DO WITH IT HERE!!!
                break
        else
                date
                echo whateverfile.file Does Not Exist Yet. Sleeping 120 seconds until whateverfile.file Found.
                sleep 120
                TOTALTIME=`expr $TOTALTIME + $SLEEPTIME`
                if [ "$TOTALTIME" -gt "$CANCELTIME" ]
                then
                        echo The file has not been found in the set amount of time.
                        echo Program Canceling.
                        echo TOTALTIME equals $TOTALTIME
                        echo QUITING
                        exit
                else
                        echo .
                fi
        fi
done



That will run all day long and check for the file every two minutes
if it finds it, set it to do whatever you want, if it doesnt find it, it kills the script. Run this every morning via cron.

Last edited by Create; 02-04-2007 at 01:15 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

UNIX PATH info required PLEASE HELP (I'm new to unix)

I need to know how to enter a unix path in a cgi script for a guest book: example: My URL is http://www.kitachi.info I have an html file in the main folder on my site, the file is called : gbook.html what would the correct unix path for this file be ??? the part of the script... (1 Reply)
Discussion started by: akitachi
1 Replies

2. Shell Programming and Scripting

Need to find created date of file in UNIX

I need to write a script which has to list all the files which are created before six months from now. kindly help on this ... (7 Replies)
Discussion started by: amirthraj_12
7 Replies

3. UNIX for Dummies Questions & Answers

Open .zip file created in UNIX

Hi I am using the unix zip command to zip a file name to name .zip. I am then ftping the file to my windows Xp desktop and trying to open it using compressed(zipped) folders. Then iam getting an error like 'the compressed(zipped) folder is invalid or corrupted' Please advice. regards,... (5 Replies)
Discussion started by: sam99
5 Replies

4. UNIX for Dummies Questions & Answers

How to findout the files which are created after 12AM in unix server

Hi Friends, I want to get the list of the files which are created after 12AM in the server. Please help me on this to write a script. Thanks Sreenu. (1 Reply)
Discussion started by: sreenu80
1 Replies

5. Shell Programming and Scripting

Excel sheet to be created from unix.

Hi Guys, I like to create a excel sheet with four tabs. Is it possible to create it. Acutually i want to apply formulas in fourth tab which uses the three different tabs. Is it possible to create such a script? Thanks & regards, Magesh (3 Replies)
Discussion started by: mac4rfree
3 Replies

6. Shell Programming and Scripting

Find unix file created how many days ago?

i want to find unix file created how many days ago? (4 Replies)
Discussion started by: utoptas
4 Replies

7. Shell Programming and Scripting

Expand cells in .xls file created in unix

Hi Guys, I am creating a comma separated file by quering the table and routing it to a file with an extension .xls. I am using the mailx command to send the .xls file to windows mail box. The file is coming as a excel attachment, but the cells are not expanded. Is there a way by which... (4 Replies)
Discussion started by: mac4rfree
4 Replies

8. HP-UX

How to find a file created in UNIX every monday.???

Hi All Any one please suggest me... I have one directory every monday one file will be created in that directory. so if the file is created on monday or not i need check first. How can write a script??? if the file is not created i want to quit from script. Thanks K.Srinivas (5 Replies)
Discussion started by: k_s_rao7
5 Replies

9. Shell Programming and Scripting

How to send a file in UNIX through email which is created only 15 minutes before the current time?

I wanted to send an email to the client whenever there is failed record created in a /feed/HR-76/failed folder after processing of feed file. I can find out with the help of below script that what is the new file created but that file didn't make just 15 minutes before. ... (1 Reply)
Discussion started by: puneetkhullar
1 Replies

10. Shell Programming and Scripting

How to store info from a txt file into a hash?

I'm trying to make a perl script using the "open" command to open and read a file, storing the information in said file into a hash structure. This is what is inside my file- Celena Standard F 01/24/94 Cancer Jeniffer Orlowski F 06/24/86 None Brent Koehler M 12/05/97 HIV Mao Schleich... (4 Replies)
Discussion started by: Eric1
4 Replies
echo(3XCURSES)						  X/Open Curses Library Functions					    echo(3XCURSES)

NAME
echo, noecho - enable/disable terminal echo SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib -R /usr/xpg4/lib -lcurses [ library... ] c89 [ flag... ] file... -lcurses [ library... ] #include <curses.h> int echo(void); int noecho(void); DESCRIPTION
The echo() function enables Echo mode for the current screen. The noecho() function disables Echo mode for the current screen. Initially, curses software echo mode is enabled and hardware echo mode of the tty driver is disabled. The echo() and noecho() functions control soft- ware echo only. Hardware echo must remain disabled for the duration of the application, else the behavior is undefined. RETURN VALUES
Upon successful completion, these functions return OK. Otherwise, they return ERR. ERRORS
No errors are defined. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
getch(3XCURSES), getstr(3XCURSES), initscr(3XCURSES), libcurses(3XCURSES), scanw(3XCURSES), attributes(5), standards(5) SunOS 5.10 5 Jun 2002 echo(3XCURSES)
All times are GMT -4. The time now is 01:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy