[Remind-Fans] daemon mode - include file update

Christoph Scheurer christoph.scheurer at web.de
Thu Mar 19 02:21:36 EDT 2009


Hi,

> > > > You could touch it from a cron job so ...
> > If you use a directory with your main reminders file and all the
> > included files you can express the dependencies easily with a
> > Makefile in the same directory and have a cron-job (or even remind in
> > daemon-mode itself) run make to update the main reminders file
> > on-demand with a rule like this:
> > 
> > REMIND_INCLUDES = $(wildcard remind-*)
> > 
> > reminders: $(REMIND_INCLUDES)
> > 	@touch $@

> The main file and its include files are in the same folder but don't
> follow a particular naming convention.
> 
> 
> REMIND_INCLUDES = $(wildcard *)
> 
> reminders: $(REMIND_INCLUDES)
> 	@touch main 
> 
> changes the date of the main reminder file to the date of the newest
> include if it is newer than main.
> 
> It throws up an error though (which I suppose I could simply ignore but
> it's a bit untidy):
> "make: Circular reminders <- reminders dependency dropped."
> 
> Presumably this happens because main is dependency as well as target.
> Is there a way to exclude main from the include list?

You can avoid that by filtering out the main reminders file like this:

reminders: $(filter-out $@, $(REMIND_INCLUDES))
	@touch $@

Btw. make allows you to build up the file list successively if you want:

REMIND_INCLUDES = file1
REMIND_INCLUDES += file2 file3

etc.

> If I wanted to run the makefile from remind, would I have to set up a
> reminder which is scheduled to RUN make every five minutes or so? I
> prefer this solution to a cron job as this would keep everything in one
> place.
Yes, I would use a RUN similar to this:

REM ... RUN make --silent -C /path/to/directory/with/reminders

I guess you could also use filedir() to determine the correct path, but from
the remind man page I am not sure how to always get the full absolute path.

Kind regards,

Ch. Scheurer

-- 
Christoph Scheurer                                  GnuPG key Id: 0x6128C6B6



More information about the Remind-fans mailing list