Re: [CentOS] Detect file change

2010-01-26 Thread Les Mikesell
Alan Hoffmeister wrote: >> You could just run rsync periodically without checking anything. It will >> only >> transfer files that have changed and will walk the whole tree doing the >> comparisons with the -R or -a options. >> >> > Yeah i know, but my work is sync lots of small files (hundre

Re: [CentOS] Detect file change

2010-01-26 Thread John Doe
From: Alan Hoffmeister > > You could do something like (untested): > >CHECKFILE="/path/to/checkfile" > >if [! -f $CHECKFILE]; then touch $CHECKFILE; fi > >find -cnewer $CHECKFILE | myscript.sh > >touch $CHECKFILE > I think that now we are on the way, but this script compare the >

Re: [CentOS] Detect file change

2010-01-26 Thread Alan Hoffmeister
> You could just run rsync periodically without checking anything. It will only > transfer files that have changed and will walk the whole tree doing the > comparisons with the -R or -a options. > > Yeah i know, but my work is sync lots of small files (hundreds of them), and rsync will stay

Re: [CentOS] Detect file change

2010-01-26 Thread Les Mikesell
Alan Hoffmeister wrote: > Hello everyone! > > How can I detect if a folder have changed (sync logic) than run a script > if it's true? > I found this script over the net, but I think it's such complicated for > that simple thing... > You could just run rsync periodically without checking anyth

Re: [CentOS] Detect file change

2010-01-26 Thread Toby Bluhm
Alan Hoffmeister wrote: > Em 26/01/2010 10:38, Wade Hampton escreveu: >> If you know C, you can write a simple program using >> inotify(7). For example, you could write a program >> to continually monitor the directory and pass >> in the script plus args as a arg. >> >> See: http://www.ibm.com/de

Re: [CentOS] Detect file change

2010-01-26 Thread Alan Hoffmeister
Em 26/01/2010 10:38, Wade Hampton escreveu: > If you know C, you can write a simple program using > inotify(7). For example, you could write a program > to continually monitor the directory and pass > in the script plus args as a arg. > > See: http://www.ibm.com/developerworks/linux/library/l-ino

Re: [CentOS] Detect file change

2010-01-26 Thread Alan Hoffmeister
> You could do something like (untested): > >CHECKFILE="/path/to/checkfile" >if [! -f $CHECKFILE]; then touch $CHECKFILE; fi >find -cnewer $CHECKFILE | myscript.sh >touch $CHECKFILE > > JD > I think that now we are on the way, but this script compare the CHECKFILE whit what? _

Re: [CentOS] Detect file change

2010-01-26 Thread Wade Hampton
If you know C, you can write a simple program using inotify(7). For example, you could write a program to continually monitor the directory and pass in the script plus args as a arg. See: http://www.ibm.com/developerworks/linux/library/l-inotify.html Cheers, -- Wade Hampton

Re: [CentOS] Detect file change

2010-01-26 Thread John Doe
From: Alan Hoffmeister >How can I detect if a folder have changed (sync logic) than run a >script if it's true? >>I found this script over the net, but I think it's such complicated for >that simple thing... You could do something like (untested): CHECKFILE="/path/to/checkfile" if [! -f $CHE

Re: [CentOS] Detect file change

2010-01-26 Thread Rajagopal Swaminathan
Greetings, On Tue, Jan 26, 2010 at 4:50 PM, Alan Hoffmeister wrote: > Hello everyone! > > How can I detect if a folder have changed (sync logic) than run a script if > it's true? > inotify perhaps? never tried that though... regards, Rajagopal ___ C

Re: [CentOS] Detect file change

2010-01-26 Thread Renato Botelho
On Tue, Jan 26, 2010 at 9:31 AM, Alan Hoffmeister wrote: > Em 26/01/2010 09:28, Renato Botelho escreveu: >> >> IIRC, fam, gamin and some other softwares can do it for you. >> >> > Could you point me some "how to"? I never played with it, but you can start reading here: http://www.gnome.org/~veil

Re: [CentOS] Detect file change

2010-01-26 Thread Alan Hoffmeister
Em 26/01/2010 09:28, Renato Botelho escreveu: > > IIRC, fam, gamin and some other softwares can do it for you. > > Could you point me some "how to"? Tanks for the help! ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo

Re: [CentOS] Detect file change

2010-01-26 Thread Renato Botelho
On Tue, Jan 26, 2010 at 9:20 AM, Alan Hoffmeister wrote: > Hello everyone! > > How can I detect if a folder have changed (sync logic) than run a script if > it's true? > I found this script over the net, but I think it's such complicated for that > simple thing... IIRC, fam, gamin and some other