[Raspberry Pi] at コマンドの結果をメール送信しない

Raspberry Pi で at コマンドでジョブを実行すると、結果が出力されたメールが届くことに気付いた。SSH でアクセスしたりすると You have mail in /var/mail/pi と表示される。

at コマンドを実行してもメールを送信しないようにするには、コマンドの末尾に > /dev/null 2>&1 を付与すればいい。例えば以下のような感じだ。

$ echo "[コマンド] > /dev/null 2>&1" | at now +10minutes

これで at コマンドのジョブ実行のたびにメールが届かなくなった。

参考:
EZ-NET: 標準出力や標準エラーの内容を捨てる – Linux シェルスクリプトプログラミング
http://program.station.ez-net.jp/special/handbook/sh/system/stderr.asp

Unix “at” command: I don’t want it saving output to /var/mail/ – Super User
https://superuser.com/questions/390451/unix-at-command-i-dont-want-it-saving-output-to-var-mail

linux – How to disable mailed output for an at job? – Unix & Linux Stack Exchange
https://unix.stackexchange.com/questions/283504/how-to-disable-mailed-output-for-an-at-job