0

I am able to send body of text with blat and also schedule task with nncron to send at specified time.

Now I want to echo the failure of the ping to another file and send it using email via blat. something like this:

ping -n 4 %%a| findstr "TTL=">>%log% || (
<<want to write to unreachables log here>>
Blat body.txt -i "on behalf of name" -to name@domain -attach %hosts% -attach %unreachables%
)

Please let me know how I can write to the other file then email it.

4

1 回答 1

1
ping -n 4 %%a| findstr "TTL=">>%log% || (
echo ping to %%a failed >>%unreachables%
Blat body.txt -i "on behalf of name" -to name@domain -attach %hosts% -attach %unreachables%
)

应该向其名称所在的文件产生一条消息unreachables

于 2013-03-22T11:06:07.050 回答