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 PROTECTED] < /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Ā®? -- Karsten M. Self <kmself@ix.netcom.com> http://www.netcom.com/~kmself Evangelist, Opensales, Inc. http://www.opensales.org What part of "Gestalt" don't you understand? Debian GNU/Linux rocks! http://gestalt-system.sourceforge.net/ K5: http://www.kuro5hin.org GPG fingerprint: F932 8B25 5FDD 2528 D595 DC61 3847 889F 55F2 B9B0
pgpSUZRLhQhMZ.pgp
Description: PGP signature