![]() |
![]() |
![]() |
![]() |
||
![]() |
||
![]() |
![]() |
![]() |
![]() |
||
|
|
||
![]() |
||
![]() |
![]() |
![]() |
![]() |
||
![]() |
||
This article is from the AmigaUUCP
FAQ, by Marc SCHAEFER,
In many cases you will want to have scripts run from dcron to send automated postings, mailings, or do other automated tasks such as backups. Usually bookeeping is made a lot easier if you have these script files send you local mail containing the results of their actions (such as log files or a success/failure message).
The easiest way to send a message to yourself from a script is to use the sendmail program. Please refer to the manual page for more information. Essentially there are two ways to do this depending on the type of message you want to send:
If you wish to send a simple message to yourself and include some sort of generated log file which is not formatted mail (i.e. has no headers), you can specify various headers through options to sendmail and also include the -raw option.
sendmail -raw -f cron -t dillon -s "backups completed" <t:logfile
On the otherhand, if you have some sort of monthly posting, such as this FAQ sheet, and want to send it automatically, and the file IS formatted mail (has normal mail headers such as 'From:' and 'To:' and 'Subject:') you can use the following:
sendmail <mail_file
Since the headers are in the file, no other command line options are necessary, though you can effectively ADD additional recipients through appropriate command line options.
 
Continue to:
![]() |
|
|