|
|
|
¸®´ª½ºÆÁ Go Unix Power Tools Online Book
Go Bash Guide
|
|
Read No. 131 article |
2002-03-25 17:51:18 |
|
|
|
|
NickName |
Ç®ºñ´© |
Subject |
ÁöÁ¤ÇÑ ½Ã°£¿¡ ¸ÞÀÏ º¸³»±â.. |
|
|
#1/bin/bash
# ÁöÁ¤ÇÑ ½Ã°£¿¡ ÷ºÎÆÄÀÏ ¸ÞÀÏ º¸³»´Â ½ºÅ©¸³Æ®
dateis=$(date|awk '{print $1}') # ¿äÀÏÀ» ºÒ·¯¿È
timeis=$(date|awk '{print $4}'|cut -c1-2) # ÇöÀçÀÇ ½Ã°£À» ºÒ·¯¿È
fileis="/root/c/$1" # º¸³¾ ÆÄÀÏÀÇ À§Ä¡
limit=22 # Á¦Çѽð£
sendtime=2200 # º¸³¾½Ã°£(Á¦Çѽ𣿡 ºÐ
´ÜÀ§Ãß°¡)
title="¸®Æ÷Æ®_19611925_¼ÕÈñÅÂ_B¹Ý_8Á¶" # ¸ÞÀÏ Á¦¸ñ
#mailadd="lovecell77 at yahoo.co.kr sontina at chollian.net" # º¸³¾ ¸ÞÀÏ ÁÖ
¼Ò (¿©·¯°÷ º¸³¾¶§´Â ÇÑľ¿ ¶ç¿ì¸é µÊ)
mailadd="lovecell77 at yahoo.co.kr sontina at chollian.net
tankboi at dongguk.edu" # º¸³¾ ¸ÞÀÏ ÁÖ¼Ò (¿©·¯°÷ º¸³¾¶§´Â ÇÑľ¿ ¶ç¿ì¸é
µÊ)
echo " ·¹Æ÷Æ® Á¦Ãâ" > /tmp/contents # º¸³¾ ¸ÞÀÏ ³»
¿ë
echo " ==================================" >> /tmp/contents # º¸³¾
¸ÞÀÏ ³»¿ë
echo " Çйø: 19611925" >> /tmp/contents
echo " À̸§: ¼ÕÈñÅÂ" >> /tmp/contents
echo >> /tmp/contents
echo " ·¹Æ÷Æ® Á¦Ãâ ÇÕ´Ï´Ù" >> /tmp/contents
uuencode $fileis 19611925_\(¼ÕÈñÅÂ_B_8\).c > /tmp/data.txt
cat /tmp/contents >> /tmp/data.txt
rm -rf /tmp/contents
echo "date is $dateis , time is $timeis" # ÇöÀçÀÇ ¿äÀÏ°ú ½Ã°£À»
Ç¥½Ã
if [ -f $fileis ]; then # ¸¸¾à ÇØ´ç ÆÄÀÏÀÌ ÀÖ´Ù
¸é
if [ $dateis = "Mon" ] && (( $timeis < $limit )) ; then #
¿ù¿äÀÏÀÌ°í Á¦ÇÑ ½Ã°£ ÀÌÀüÀ϶§
echo "mail -s ""$title"" $mailadd < /tmp/data.txt "
> /tmp/mailsend.tmp
at $sendtime < /tmp/mailsend.tmp # º¸³¾½Ã°£¿¡ ¸ÞÀÏÀ» º¸³»
µµ·Ï ¿¹¾à
rm -rf /tmp/mailsend.tmp
atq # at ÀÛ¾÷ ÇÁ·Î¼¼½º º¸¿©
ÁÖ±â
else # ¿ù¿äÀÏÀÌ ¾Æ´Ï°Å³ª, Á¦Çѽð£ ÀÌÈÄÀ϶§
mail -s "$title" $mailadd < /tmp/data.txt
fi
else
echo "##### usage : mailten filename ######"
fi
~
|
|
Page Loading [ 0.04 Sec ]
SQL Time [ 0.01 Sec ]
|
|
|