Re: Command to check that a directory changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,.

finally I have used your solution but with the -c option of stat:

stat -c "%z" $DIR

I have used that because my script access the dir to copy/check files and
that generates new changes using -t option

Thank you very much for your help

ESG



2010/10/29 Humphrey Widjaja <hwidjaja@xxxxxxxxx>

> Try using stat, example:
>
> OLD=`stat -t testdir`
> while true
> do
> NEW=`stat -t testdir`
> [ "$NEW" == "$OLD" ] || echo "changed!"
> sleep 3
> done
>
> Best Regards,
>
>
> Hum / Humphrey K. Widjaja
>
>
>
> On Fri, Oct 29, 2010 at 5:08 PM, ESGLinux <esggrupos@xxxxxxxxx> wrote:
> > Hi all,
> >
> > I´m making a bash script and I need to know when a new file appears in a
> > directory.
> >
> > anybody knows if is there a command that to that or i need to use a
> > commbination of some commands  (ls, wc, sleep, cron...)
> >
> > Thanks in advance
> >
> > ESG
> > --
> > redhat-list mailing list
> > unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
> > https://www.redhat.com/mailman/listinfo/redhat-list
> >
>
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
>
-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list



[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux