Polling/Interrogate Directory Questions


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Polling/Interrogate Directory Questions
# 1  
Old 06-14-2005
Polling/Interrogate Directory Questions

Hello, need some ideas on the control statement for a script that will watch a directory, looking for any duplicate records as they are added.

I was thinking about a process that would watch the dir in a time window. Whenever a new line or entry was made I would grep the existing file for any exact lines that match.

Not sure about how to do this, maybe check on " ls | wc -l " or something similiar. Not sure about the control logic, while loop or a for statement.

Any ideas would be appreciated.

thanks, david
# 2  
Old 06-14-2005
... just for clarification ...

1. files come into directory
2. files have records
3. files may have duplicate records
4. you want to remove duplicate records in files

right?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Polling file

HI I need some help on this below one Have summuary file coming on daily basis with list of file names and count ,if the summuary file not exist ,pool it for every 5 mins till it arrives .Once arrived remove first and last line from the file and check all the files in respective director all... (12 Replies)
Discussion started by: mohan705
12 Replies

2. Programming

Db polling...

Hi! Im trying to make a program that polls a mysqlDB every 5 minutes. the poll checks a scheduletable in the dB and exicutes a function if there was a "go" in the scheduletable, and if it retrives a "no go" from the table it should just wait for another 5 minutes before re polling the DB, ... (1 Reply)
Discussion started by: karlblau
1 Replies

3. UNIX for Dummies Questions & Answers

Noob questions.. Append output to a file in different directory

Noob question! I know almost nothing so far, and I'm trying to teach myself from books, on a typical command line without using scripts how would I append output from a sort to a file in a completely different directory? example: If I'm sorting a file in my documents directory but I... (2 Replies)
Discussion started by: Byrang
2 Replies

4. Solaris

NTP polling interval

Is it possible to change the ntp poll manually. I notice that ntp poll is changing autimatically. (1 Reply)
Discussion started by: ningy
1 Replies

5. Shell Programming and Scripting

Unix Polling agent

I plan to run a script which will run in background and at predefined times send mails to user . I dont have acees to autosys/ Cron / at jobs My loop works like this while (true) do getx_time=`date +%H%M` if ; then script1.sh mail_sent_flag=1 elif ; then script2.sh... (1 Reply)
Discussion started by: ultimatix
1 Replies

6. Solaris

Newbie questions about HOME directory files

Hi, I am newbie to Solaris and system administration in general, and I have a couple of questions about files in my HOME directory. When I perform ls -la, I get the following list of files: drwxr-xr-x 7 XXXYYY staff 17 Aug 24 07:31 . drwxr-xr-x 7 root root 7... (2 Replies)
Discussion started by: JVerstry
2 Replies

7. UNIX for Advanced & Expert Users

How to avoid polling???

Hi all, I have a directory where some process is keeping incremental/new log files. I need to code a program which will periodically poll this directory and if it founds a new file arrived then copy that new file to some other specific directory. We are OK with this polling approach. I just... (3 Replies)
Discussion started by: zing_foru
3 Replies

8. UNIX for Dummies Questions & Answers

Dummy questions about how to get the size of a directory by command

Hi, 'ls -ld' is no use .... I want to get the total size of a directory. Any advice? Thanks in advance! (4 Replies)
Discussion started by: GCTEII
4 Replies

9. Shell Programming and Scripting

Dummy questions about how to get the size of a directory by command

Hi, 'ls -ld' is no use .... I want to get the total size of a directory including subdir. Any advice? Thanks in advance (2 Replies)
Discussion started by: GCTEII
2 Replies

10. Programming

Help - Polling Script

How do I write a shell script to perform polling just like what happens with Microsoft mail. i.e display an alert box. (1 Reply)
Discussion started by: brianmu
1 Replies
Login or Register to Ask a Question