close
如果想用 shell script 發送郵件,可以用 mail 實現:

# echo "email content" | mail -s "email subject" you@emaildomain

以上語句會發送一封標題為 "email subject" 的電郵到 you@emaildomain,其中 "email content" 為電郵內容。

以下簡單的兩行 shell script 便會將檔案系統使用量,透過電郵發送給指定的電郵信箱:

#!/bin/sh
/bin/df -h | /usr/bin/mail -s "server capacity" you@emaildomain

arrow
arrow
    全站熱搜

    kevin0523 發表在 痞客邦 留言(0) 人氣()


    留言列表 留言列表

    發表留言