Sponsored Content
Full Discussion: Generic Filewatcher
Top Forums Shell Programming and Scripting Generic Filewatcher Post 302776449 by dikesm on Wednesday 6th of March 2013 10:52:19 AM
Old 03-06-2013
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
Code:
a.sh
b.sh c.sh d.sh
e.sh

In this case,we can have
a.sh executed first followed sequentially
by b.sh,c.sh,d.sh which can be executed in parallel.post b.sh,c.sh and d.sh execution successfully,
e.sh needs to be executed.
Also for each shell script their stderr and stdout should be logged.

So overall,the file watcher might watch for any file existence in a particular directory again configured in a master file.
eg.contents of the master file
Code:
ABC.txt ABC.config
PQR.txt PQR.config

ABC.config might be as below:
Code:
a.sh
b.sh c.sh d.sh
e.sh

PQR.config might be as below:
Code:
q.sh
r.sh 
s.sh

Would it be possible to achieve this using basic bash shell scripting?

Regards,
Dikesh Shah.

Last edited by jim mcnamara; 04-14-2013 at 08:23 PM..
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

GENERIC Kernel

How do I update, change, reconfigure or whatever it is that I have to do, in order to rid the GENERIC label. It just means that it is the basic kernel shipped with the OS right? Im using FBSD 4.5 (2 Replies)
Discussion started by: savage
2 Replies

2. Shell Programming and Scripting

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... (2 Replies)
Discussion started by: bhagat.singh-j
2 Replies

3. Shell Programming and Scripting

generic way - help required

All, This is what I did: Suppose: $ line="23|12|21" $ eval $(echo "$line" | awk -F'|' '{print "V1="$1";V2="$2";V3="$3}') $ echo $V1 23 $ echo $V2 12 $ echo $V3 21 (3 Replies)
Discussion started by: uwork72
3 Replies

4. 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

5. UNIX for Advanced & Expert Users

Is aclocal.m4 generic?

can we copy higher version aclocal to our software. Is there any good book for automake,aclocal.m4,configure.sub,configure.guess that explains clearly about how they are related , how to modify them etc Thanks Gopi (1 Reply)
Discussion started by: Gopi Krishna P
1 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. 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

8. 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
watcher(3)							     net-snmp								watcher(3)

NAME
watcher - Watch a specified variable and process it as an instance or scalar object. Functions netsnmp_mib_handler * netsnmp_get_watcher_handler (void) netsnmp_watcher_info * netsnmp_create_watcher_info (void *data, size_t size, u_char type, int flags) int netsnmp_register_watched_instance (netsnmp_handler_registration *reginfo, netsnmp_watcher_info *watchinfo) int netsnmp_register_watched_scalar (netsnmp_handler_registration *reginfo, netsnmp_watcher_info *watchinfo) int netsnmp_watcher_helper_handler (netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests) netsnmp_mib_handler * netsnmp_get_watched_timestamp_handler (void) int netsnmp_watched_timestamp_register (netsnmp_mib_handler *whandler, netsnmp_handler_registration *reginfo, marker_t timestamp) int netsnmp_register_watched_timestamp (netsnmp_handler_registration *reginfo, marker_t timestamp) int netsnmp_watched_timestamp_handler (netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests) netsnmp_mib_handler * netsnmp_get_watched_spinlock_handler (void) int netsnmp_register_watched_spinlock (netsnmp_handler_registration *reginfo, int *spinlock) int netsnmp_watched_spinlock_handler (netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests) int netsnmp_register_ulong_scalar (const char *name, oid *reg_oid, size_t reg_oid_len, u_long *it, Netsnmp_Node_Handler *subhandler) int netsnmp_register_read_only_ulong_scalar (const char *name, oid *reg_oid, size_t reg_oid_len, u_long *it, Netsnmp_Node_Handler *subhandler) int netsnmp_register_long_scalar (const char *name, oid *reg_oid, size_t reg_oid_len, long *it, Netsnmp_Node_Handler *subhandler) int netsnmp_register_read_only_long_scalar (const char *name, oid *reg_oid, size_t reg_oid_len, long *it, Netsnmp_Node_Handler *subhandler) int netsnmp_register_int_scalar (const char *name, oid *reg_oid, size_t reg_oid_len, int *it, Netsnmp_Node_Handler *subhandler) int netsnmp_register_read_only_int_scalar (const char *name, oid *reg_oid, size_t reg_oid_len, int *it, Netsnmp_Node_Handler *subhandler) int netsnmp_register_read_only_counter32_scalar (const char *name, oid *reg_oid, size_t reg_oid_len, u_long *it, Netsnmp_Node_Handler *subhandler) Detailed Description Watch a specified variable and process it as an instance or scalar object. Version 5.4.2 5 Sep 2008 watcher(3)
All times are GMT -4. The time now is 01:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy