Problem with filewatcher...


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Problem with filewatcher...
# 1  
Old 11-03-2006
Problem with filewatcher...

Hi everyone,
Please find the script for Filewatcher rule file,which does the simple job of moving the files whenever it dectects to another directory.And whenever it detects the cmd_mm.stop file,it should terminate the job.

INTERVAL 60

ON_FILEWATCH ${HLD}/CMD/* CREATE 0 1 2 0400 5
THEN
DO_CMD mv ${HLD}/CMD/* ${HLD}/CMD_SCRIPTS
ELSE
DO_CMD echo "File not detected."
END_ON

#The following command watches for stop file to terminate the job for the day.
ON_FILEWATCH ${HLD}/CMD/cmd_mm.stop CREATE 0 0 30 0400 31
THEN
DO_CMD rm ${HLD}/CMD/cmd_mm.stop
DO_OK
END_ON


Now the problem is that creation of cmd_mm.stop file of zero size doesn't seem to terminte the job.The job simply moves cmd_mm.stop file to ${HLD}/CMD_SCRIPTS directory and carries on and on with filewatching.
(Note:cmd_mm.stop file is of zero size.)
Thoughts plz?
Thanks for all the solutions that I've got from experts of this forum.
Bhagat
# 2  
Old 11-03-2006
Exclude the stop file from the first ON_FILEWATCH or Invert the two rules.

Jean-Pierre.
# 3  
Old 11-03-2006
You mean my rule file should look like this?

INTERVAL 60
#The following command watches for stop file to terminate the job for the day.
ON_FILEWATCH ${HLD}/CMD/cmd_mm.stop CREATE 0 0 30 0400 31
THEN
DO_CMD rm ${HLD}/CMD/cmd_mm.stop
DO_OK
END_ON

ON_FILEWATCH ${HLD}/CMD/* CREATE 0 1 2 0400 5
THEN
DO_CMD mv ${HLD}/CMD/* ${HLD}/CMD_SCRIPTS
ELSE
DO_CMD echo "File not detected."
END_ON
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sed Or Grep Problem OR Terminal Problem?

I don't know if you guys get this problem sometimes at Terminal but I had been having this problem since yesterday :( Maybe I overdid the Terminal. Even the codes that used to work doesn't work anymore. Here is what 's happening: * I wanted to remove lines containing digits so I used this... (25 Replies)
Discussion started by: Nexeu
25 Replies

2. Shell Programming and Scripting

Filewatcher

hi All, I ned to write a filewatcher script, with following requirements. 1. The script should look for the file in every 5 min. 2. If the file is found, it should check in every 3 min the size of file. 3. if the file size has not changed in last 4 iterations (i.e. in last 12 min), the... (2 Replies)
Discussion started by: alok2082
2 Replies

3. Shell Programming and Scripting

Generic Filewatcher

Hi, I have a requirement wherein i need to have a generic file watcher in place. On presence of a file in a particular directory,the file watcher should identify the related config file and execute the series of the shell scripts mentioned in the config file. eg.Config file a.sh b.sh... (7 Replies)
Discussion started by: dikesm
7 Replies

4. UNIX for Dummies Questions & Answers

Filewatcher job

Hi Friends iam using a filewatcher job which checks the path in intervals below is the script #!/bin/ksh fileflag=0 timer1=0 check_interval=120 # check every 2 minutes (( check_interval_minutes=${check_interval}/60 )) while do if then echo "My file exists now..." | mailx -s... (7 Replies)
Discussion started by: robertbrown624
7 Replies

5. IP Networking

Problem with forwarding emails (SPF problem)

Hi, This is rather a question from a "user" than from a sys admin, but I think this forum is apropriate for the question. I have an adress with automatic email forwarding and for some senders (two hietherto), emails are bouncing. This has really created a lot of problems those two time so I... (0 Replies)
Discussion started by: carwe
0 Replies

6. Shell Programming and Scripting

Autosys filewatcher + ksh script

Hi, A ------> B ------> C I have a scenario where each day, my server B would ftp to server A and pull (A,B,C,D,E) from a specific directory. Server C would need files (B,D) only when server B finished receiving from server A. These files change everyday, so sometimes it takes longer... (3 Replies)
Discussion started by: arex876
3 Replies

7. AIX

AIX OS problem? network problem?

Dear ALL. I installed AIX OS on customer sites. but Only one site is too slow when I connected telnet, ftp.. Ping is too fast. but telnet and FTP is not connected.. of course i check the configuration file on aix but it's normal. Do any Idea?? thanks in advance. - Jun - (3 Replies)
Discussion started by: Jeon Jun Seok
3 Replies

8. AIX

user login problem & Files listing problem.

1) when user login to the server the session got colosed. How will resolve? 2) While firing the command ls -l we are not able to see the any files in the director. but over all view the file system using the command df -g it is showing 91% used. what will be the problem? Thanks in advance. (1 Reply)
Discussion started by: pernasivam
1 Replies

9. Shell Programming and Scripting

FileWatcher Script

Hi All, Sorry to post these many questions on UNIX. i am new to unix & got only UNIX work in my organization. I need to make a script for File Arrival Check. 1. The script should wait for indicator file for configured amount of time. 2. If the file is not received after the configured... (4 Replies)
Discussion started by: Amit.Sagpariya
4 Replies

10. Solaris

problem in finding a hardware problem

Hi I am right now facing a strange hardware problem. System get booted with the following error: Fatal Error Reset CPU 0000.0000.0000.0003 AFSR 0100.0000.0000.0000 SCE AFAR 0000.07c6.0000.1000 SC Alert: Host System has Reset It happen 4 or 5 times and get the same error every time.I... (8 Replies)
Discussion started by: girish.batra
8 Replies
Login or Register to Ask a Question