LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-27-2004, 02:16 PM   #1
bmeckle
Member
 
Registered: Jun 2004
Posts: 60

Rep: Reputation: 15
file watcher job


I need a way to watch for a file and if the file exists run a script.

I think I have most of the pieces.
I am hoping to use cron to run a statement similar to this.

test -e $file
if test -e $file = 0
then execute script
fi

this doesn't seem to work though.
Can anybody tell me what I am doing wrong?


Thanks
 
Old 07-27-2004, 03:40 PM   #2
bmeckle
Member
 
Registered: Jun 2004
Posts: 60

Original Poster
Rep: Reputation: 15
I found an answer.

if [ -e $file ] ; then
execute script
fi

This is the proper syntax and seems to work great.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet watcher mrspcs Linux - Software 5 10-20-2005 10:51 AM
Suse Watcher always Orange Ipsofacto Linux - Software 2 10-03-2005 10:59 AM
cron job to send file via ftp every 1 hour mcalizo Linux - Newbie 1 07-14-2004 03:50 AM
File or direcroty watcher and emailer enkrypter Linux - Software 1 04-15-2004 07:08 AM
cron job that email a text file paynsr Linux - Newbie 1 03-29-2004 01:36 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration