Register
It is currently Wed Oct 01, 2014 6:14 am

Run script when file changes


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Thu Aug 21, 2014 3:40 am   

Joined: Thu Aug 21, 2014 3:29 am
Posts: 2
Hi, I am new to bash scripting and this is my first post. I have a file (say called test1) in a directory. Rsync, on another computer, copies a new test1 file into that directory from time to time. The name is always the same but the new file will have different content, creation date and size. I am trying to write a bash script that will know when the file has changed and will then run another script. If there is no change it should do nothing.
Any suggestions on the way to do this?
Jodel


Top
 Profile  
 PostPosted: Thu Aug 21, 2014 5:40 am   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 549
hi,

can you be root ? if so, then install incron; this is inotify cron


Top
 Profile  
 PostPosted: Thu Aug 21, 2014 6:35 am   

Joined: Thu Aug 21, 2014 3:29 am
Posts: 2
Thanks for the reply. I have root access and I have just downloaded incron.
I will also google for some examples to see if I can find examples of its use.

Jodel


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP