| 186 | == 実行サンプル == |
| 187 | * /etc/cron.hourly/crontest |
| 188 | {{{ |
| 189 | #!/bin/sh |
| 190 | |
| 191 | ( |
| 192 | /bin/df -h 2>&1 | mail -E -s "Cron <$LOGNAME@`/bin/hostname`> $0" $LOGNAME |
| 193 | ) >/dev/null 2>&1 & |
| 194 | }}} |
| 195 | * mail |
| 196 | {{{ |
| 197 | Mail version 8.1.2 01/15/2001. Type ? for help. |
| 198 | "/var/mail/mitty": 1 message 1 new |
| 199 | >N 1 root@lucid.mitty. Wed May 19 10:17 21/903 Cron <root@lucid> /etc/cron |
| 200 | & |
| 201 | Message 1: |
| 202 | From root@lucid.mitty.jp Wed May 19 10:17:01 2010 |
| 203 | X-Original-To: root |
| 204 | To: root@lucid.mitty.jp |
| 205 | Subject: Cron <root@lucid> /etc/cron.hourly/crontest |
| 206 | Date: Wed, 19 May 2010 10:17:01 +0900 (JST) |
| 207 | From: root@lucid.mitty.jp (root) |
| 208 | |
| 209 | Filesystem Size Used Avail Use% Mounted on |
| 210 | /dev/sda1 3.8G 903M 2.9G 24% / |
| 211 | none 243M 168K 243M 1% /dev |
| 212 | none 247M 0 247M 0% /dev/shm |
| 213 | none 247M 40K 247M 1% /var/run |
| 214 | none 247M 0 247M 0% /var/lock |
| 215 | none 247M 0 247M 0% /lib/init/rw |
| 216 | none 3.8G 903M 2.9G 24% /var/lib/ureadahead/debugfs |
| 217 | }}} |
| 218 | |