# vi /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth1 inet static
address 192.168.0.1
netmask 255.255.255.0
auto eth1
iface eth0 inet dhcp
# /etc/inet.d/networking restart
# vi /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth1 inet static
address 192.168.0.1
netmask 255.255.255.0
auto eth1
iface eth0 inet dhcp
# /etc/inet.d/networking restart
あるドメインで運用されているトップのメールサーバ(ルートのメールサーバ、つまり外部と通信する大元のメールサーバのこと)を調べるには、次のようにコマンドを打てばよい。
nslookup -type=mx amazonaws.com
上の例では amazonaws.com のトップのメールサーバ、つまり Amazon Web Services(AWS)の MX レコードを調べている。preference = 10 などのフィールドは、そのサーバの(通信の)優先度を表す。値が等しい場合は優先度は同じ、値が大きくなるほど優先度は低くなる。
あるドメインで運用されているトップのメールサーバ(ルートのメールサーバ、つまり外部と通信する大元のメールサーバのこと)を調べるには、次のようにコマンドを打てばよい。
nslookup -type=mx amazonaws.com
上の例では amazonaws.com のトップのメールサーバ、つまり Amazon Web Services(AWS)の MX レコードを調べている。preference = 10 などのフィールドは、そのサーバの(通信の)優先度を表す。値が等しい場合は優先度は同じ、値が大きくなるほど優先度は低くなる。
bash では、様々なコマンドを`(バッククオーテーション)で囲むと、そのコマンドを変数に入れたりすることができる。つまり、何か処理を始めたり終わったことをメールで通知する場合は次のようにする。
#!/bin/bash
echo 'Subject: Started: your_program' > temp.txt
echo 'To: yourname@yourdomain.com' >> temp.txt
echo 'Started.' >> temp.txt
cat temp.txt | `sendmail -t -i`
rm temp.txt
your_program (←ここに処理したいプログラム名(時間がかかるもの)を書く)
echo 'Subject: Completed: your_program' > temp.txt
echo 'To: yourname@yourdomain.com' >> temp.txt
echo 'Completed.' >> temp.txt
cat temp.txt | `sendmail -t -i`
rm temp.txt
cat temp.txt | `sendmail -t -i`
bash では、様々なコマンドを`(バッククオーテーション)で囲むと、そのコマンドを変数に入れたりすることができる。つまり、何か処理を始めたり終わったことをメールで通知する場合は次のようにする。
#!/bin/bash
echo 'Subject: Started: your_program' > temp.txt
echo 'To: yourname@yourdomain.com' >> temp.txt
echo 'Started.' >> temp.txt
cat temp.txt | `sendmail -t -i`
rm temp.txt
your_program (←ここに処理したいプログラム名(時間がかかるもの)を書く)
echo 'Subject: Completed: your_program' > temp.txt
echo 'To: yourname@yourdomain.com' >> temp.txt
echo 'Completed.' >> temp.txt
cat temp.txt | `sendmail -t -i`
rm temp.txt
cat temp.txt | `sendmail -t -i`
https://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/index.html?Instance_Types_and_Architectures.html より。どのインスタンスもルートパーティション(/)には1GB しか割り当てられないことに注意する。
https://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/index.html?Instance_Types_and_Architectures.html より。どのインスタンスもルートパーティション(/)には1GB しか割り当てられないことに注意する。