Monitor files


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Monitor files
# 1  
Old 11-16-2009
Monitor files

I have just started UNIX administration..I want to monitor files with a specific extensions..
ie, I want to monitor .doc or .DOC files created in particular directory..The script should display (every minute) a list of those filenames created after the previous display.
# 2  
Old 11-16-2009
1. if you want to list all the files in specified interval then,

( every 2 seconds by default )

Code:
watch ls -l

( specify time -- every 1 second )

Code:
watch -n 1 ls -l

2. script to list out only new files,

Code:
newfile=./t/a
while [ 1 ];
do
find ./t -newer $newfile -iname '*.c';
newfile=`find ./t -newer $newfile -iname '*.c' | tail -1`;
sleep 60;
done

Note 1: In the start of the script, assign correct value for the newfile variable, which should be the newer file you want to compare with.
Note 2: This may require tweaks here & there...
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Infrastructure Monitoring

Searching for Saas Monitor service which monitor my servers which are sitting in different providers

Sorry if this is the wrong forum Searching for Saas Monitor service which monitor my servers which are sitting in different providers . This monitor tool will take as less CPU as possible , and will send info about the server to main Dashboard. The info I need is CPU / RAM / my servers status (... (1 Reply)
Discussion started by: umen
1 Replies

2. Shell Programming and Scripting

Script to monitor the changes on files

Hello all, I'm planning to write a script to monitor the changes on configuration files on my application server, i have around 50 properties files which really crucial for the application to perform well but we have a challenge here is that all the application team (development, testing and... (2 Replies)
Discussion started by: Mahesh_RPM
2 Replies

3. Homework & Coursework Questions

Need shell script to monitor files

Hi Experts, I am not good in writing script. Just stared. I am looking for shell script to check following parameters. 1) Number of files on remote Linux SUSE server.- Any directory and sub directory. 2) I should define number of files in script. Files should be variable. 3) Age of the... (2 Replies)
Discussion started by: ApmPerfMonitor
2 Replies

4. Shell Programming and Scripting

Bash to monitor Modified Files/Directories

Hi All , I have a directory called "/usr/local/apache/docs/" inside this docs i have below directories , bash-2.05# pwd /usr/local/apache/docs/ bash-2.05#ls -l | less 2 drw-r-xr-x 3 root root 512 Aug 8 2010 Form1 2 drw-r-xr-x 3 root other 512 Mar 8 ... (4 Replies)
Discussion started by: gnanasekar_beem
4 Replies

5. Shell Programming and Scripting

howto monitor a directory for files then sftp them

Morning all I hope I have put this in the correct forum. I have a requirement to monitor a directory on a server for files being sftp'ed in and then to sftp them of to another server. The issues I have though of are making sure the files have completely transferred onto the server before they... (6 Replies)
Discussion started by: ltodd2
6 Replies

6. UNIX for Advanced & Expert Users

Monitor files being copied/accessed

Hello, Is there a way (without 3rd party software) to know if a file has been accessed and/or copied ? I'm interested in any solution : doing command line instructions , running background scripts etc... I apologize if I posted this in the wrong forum. Thank you! (8 Replies)
Discussion started by: prostiiinet
8 Replies

7. Shell Programming and Scripting

monitor log files

Hello, I want something like this tail -f /a/b/c/*.log | grep -i "STRING1|STRING2 " > a.txt I want to check all the log files in a particular directory then grep if any of the log files have "STRING1" and "STRING2" string and then have to send email to the group. Platform is HP-UX it... (8 Replies)
Discussion started by: RTY
8 Replies

8. UNIX for Dummies Questions & Answers

Help: script to monitor incoming files

I have 20 or so files that are ftp'd each day to a particular directory. I want to create a script that will tell me if any of these files fails to arrive or if any additional files arrive. I'm thinking I'd have a list of file names that should arrive each day, and the script would check each days... (2 Replies)
Discussion started by: daveyc82
2 Replies

9. Shell Programming and Scripting

need help doing a script to monitor if files are go through

I am trying to do a shell script to check a folder and see if files are passing through. Now if a file did not pass through in the last 1 hour send an email. ftp----------> folder to monitor ----------->ftp Now the script that moves the file runs every sec in cron, so i do not know if i... (0 Replies)
Discussion started by: jonathan184
0 Replies
Login or Register to Ask a Question