Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
incron replacement?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1459
Location: KUUSANKOSKI, Finland

PostPosted: Mon Mar 04, 2019 9:33 am    Post subject: incron replacement? Reply with quote

incron seems to be very outdated. And I think I found a bug from it.
It fails always when I try to do this simple task (in /etc/incron.d/)
Code:
/tmp/shots IN_CLOSE_WRITE sh -c 'echo $@/$# >> /tmp/shots.lst'

incron always seems to strip the last quotes or something like that. I just can't get it to work.
(I kept incron -n open on one terminal and then tried to overcome this problem.)

Does anyone know any better replacements? Or do I have to create a wrapper script for appending a line to a file... :x
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
guitou
Guru
Guru


Joined: 02 Oct 2003
Posts: 389
Location: France

PostPosted: Mon Mar 04, 2019 12:46 pm    Post subject: Reply with quote

Hello

Have you tried with double quotes too?

++
Gi)
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1459
Location: KUUSANKOSKI, Finland

PostPosted: Mon Mar 04, 2019 1:49 pm    Post subject: Reply with quote

Yup.
At least all the following:
  • Code:
    sh -c 'echo "$@/$#" >> /tmp/shots.lst'
  • Code:
    sh -c "echo '$@/$#' >> /tmp/shots.lst"

_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
Syl20
Guru
Guru


Joined: 04 Aug 2005
Posts: 547
Location: France

PostPosted: Mon Mar 04, 2019 5:53 pm    Post subject: Re: incron replacement? Reply with quote

Zucca wrote:
Does anyone know any better replacements? Or do I have to create a wrapper script for appending a line to a file... :x

I use my own scripts, using inotifywait, and /etc/local.d start/stop scripts. That works fine.

No need to write hundreds lines : https://stackoverflow.com/questions/24567608/using-inotify-in-a-script-to-monitor-a-directory
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1459
Location: KUUSANKOSKI, Finland

PostPosted: Mon Mar 04, 2019 6:14 pm    Post subject: Reply with quote

I've been using my own scripts earlier.
I just hoped there would be something like incron to ease the addition of new "inotify watchers".
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum