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

Re: Exploring the possibilities of cron



kmself@ix.netcom.com wrote:
> On Tue, Aug 22, 2000 at 09:37:05PM -0400, Mike Werner wrote:
> > Brent Harding wrote:
> > > How would cron do something such as, emailing 	a file once and awhile, make
> > > the file empty, and wait until the next run, but not mail anything if it's
> > > empty. I've never done much with emailing besides piping echo to mail, but
> > > it's limited to one line.
> > 
> > What I would do is put all of the work into a shell script, and have cron
> > call the shell script.  Just off the top of my head, something like:
> > 
> > #!/bin/sh
> > if [ -s /path/to/file ]
> >   mail -s Here's_the_file email_address@isp.com < /path/to/file
> >   rm -f /path/to/file
> >   touch /path/to/file
> > fi
> 
> Mike:  how are you planning on authenticating that the user actually
> created the file, that its permissions don't allow modification by
> others, and that there is nothing in the file which might cause a
> cron-initiated adduser script to crash, fail, overflow, or otherwise do
> Bad Things®?

Well, if you look at Brent's question, none of this is asked.  All I
answered was what he asked.  If he's worried about such things, then he can
ask about them and I'll see what I can come up with.  Until then, I won't
worry about it.  Besides, like I said numerous times in my reply, "I'm sure
that there are better ways to do it".  I said that numerous times
intentionally.
-- 
Mike Werner  KA8YSD   | He that is slow to believe anything and
                      | everything is of great understanding,
'91 GS500E            | for belief in one false principle is the
Morgantown WV         | beginning of all unwisdom.



Reply to: