Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

[FORTRAN] will persist for some time -- probably for at least the next decade. -- T. Cheatham


devel / comp.unix.shell / Re: Watchdog tool to observe files and directories?

SubjectAuthor
* Re: Watchdog tool to observe files and directories?hongy...@gmail.com
`- Re: Watchdog tool to observe files and directories?Janis Papanagnou

1
Re: Watchdog tool to observe files and directories?

<78dca6bf-ace0-4f2f-863b-9abe22d33d5fn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4220&group=comp.unix.shell#4220

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:ac8:6611:: with SMTP id c17mr3659879qtp.392.1628157387594;
Thu, 05 Aug 2021 02:56:27 -0700 (PDT)
X-Received: by 2002:a37:9bc5:: with SMTP id d188mr3930808qke.225.1628157387388;
Thu, 05 Aug 2021 02:56:27 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Thu, 5 Aug 2021 02:56:27 -0700 (PDT)
In-Reply-To: <65121839-a7f3-4eb7-8368-68f4f3b55553n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=172.104.76.156; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 172.104.76.156
References: <rp4p68$mei$1@news-1.m-online.net> <65121839-a7f3-4eb7-8368-68f4f3b55553n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <78dca6bf-ace0-4f2f-863b-9abe22d33d5fn@googlegroups.com>
Subject: Re: Watchdog tool to observe files and directories?
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Thu, 05 Aug 2021 09:56:27 +0000
Content-Type: text/plain; charset="UTF-8"
 by: hongy...@gmail.com - Thu, 5 Aug 2021 09:56 UTC

On Thursday, August 5, 2021 at 4:05:49 PM UTC+8, hongy...@gmail.com wrote:
> On Thursday, November 19, 2020 at 11:35:41 AM UTC+8, Janis Papanagnou wrote:
> > I want to inspect file status information and directory contents
> > by some watchdog tool; e.g. new files appearing in a directory or
> > a file update should be detected and indicated by an alert window.
> > This should work only on dedicated files or directories, say, by
> > calling the tool with the respective name and/or file attributes.
> > Before I'm going to write my own command line tool I'd be interested
> > if there's something like that already existing.
> There is a very helpful discussion here:
>
> https://superuser.com/questions/181517/how-to-execute-a-command-whenever-a-file-changes

Based on the suggestions given in the above discussion, I currently use the following code snippet:

inotifywait --quiet --monitor --event modify some-file-under-watch | while read change; do
do-something-here
done

HY

Re: Watchdog tool to observe files and directories?

<sekijo$a7m$1@news-1.m-online.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4221&group=comp.unix.shell#4221

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!news.karotte.org!news.space.net!news.m-online.net!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: Watchdog tool to observe files and directories?
Date: Sat, 7 Aug 2021 02:03:04 +0200
Organization: (posted via) M-net Telekommunikations GmbH
Lines: 37
Message-ID: <sekijo$a7m$1@news-1.m-online.net>
References: <rp4p68$mei$1@news-1.m-online.net>
<65121839-a7f3-4eb7-8368-68f4f3b55553n@googlegroups.com>
<78dca6bf-ace0-4f2f-863b-9abe22d33d5fn@googlegroups.com>
NNTP-Posting-Host: 2001:a61:241e:cc01:e01f:93c:56ac:7df1
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: news-1.m-online.net 1628294584 10486 2001:a61:241e:cc01:e01f:93c:56ac:7df1 (7 Aug 2021 00:03:04 GMT)
X-Complaints-To: news@news-1.m-online.net
NNTP-Posting-Date: Sat, 7 Aug 2021 00:03:04 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
X-Enigmail-Draft-Status: N1110
In-Reply-To: <78dca6bf-ace0-4f2f-863b-9abe22d33d5fn@googlegroups.com>
 by: Janis Papanagnou - Sat, 7 Aug 2021 00:03 UTC

On 05.08.2021 11:56, hongy...@gmail.com wrote:
> On Thursday, August 5, 2021 at 4:05:49 PM UTC+8, hongy...@gmail.com wrote:
>> On Thursday, November 19, 2020 at 11:35:41 AM UTC+8, Janis Papanagnou wrote:
>>> I want to inspect file status information and directory contents
>>> by some watchdog tool; e.g. new files appearing in a directory or
>>> a file update should be detected and indicated by an alert window.
>>> This should work only on dedicated files or directories, say, by
>>> calling the tool with the respective name and/or file attributes.
>>> Before I'm going to write my own command line tool I'd be interested
>>> if there's something like that already existing.
>> There is a very helpful discussion here:
>>
>> https://superuser.com/questions/181517/how-to-execute-a-command-whenever-a-file-changes
>
> Based on the suggestions given in the above discussion, I currently use the following code snippet:

In my case (the task behind the original post) it is something like

inotifywait -q -m -e create -e delete "${dir}" |
while read WHERE EVENT FILE
...check for file pattern and trigger a 'zenity' dialog...

i.e. triggering 'create' and 'delete' events on files matching a
specific pattern, and notifying about those events using 'zenity'.

('zenity' isn't optimal here, but each tool has it's drawbacks.)

Janis

>
> inotifywait --quiet --monitor --event modify some-file-under-watch | while read change; do
> do-something-here
> done
>
> HY
>


devel / comp.unix.shell / Re: Watchdog tool to observe files and directories?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor