Unix/Solaris °ü·Ã°Ô½ÃÆÇ

2000/07/19(19:40) from 203.254.154.69
ÀÛ¼ºÀÚ : °­ÁÙ±â (jkkang65@hanmail.net) Á¶È¸¼ö : 2379 , ÁÙ¼ö : 53
crontab ¸í·É¾î »ç¿ë¹ý
crontab
ÇöÀç crontab fileÀ» º¸±âÀ§Çؼ­´Â crontab -l À» »ç¿ëÇÑ´Ù.
* cron daemonÀº ½Ã½ºÅÛ booting½Ã¿¡ ÀÚµ¿À¸·Î ½ÃÀ۵ȴÙ.
* cron daemonÀº /var/spool/cron/crontabs µð·ºÅ丮¿¡ ÀÖ´Â crontabÈ­ÀÏÀ» Àд´Ù.
* ÀÌ ¸í·É¾î´Â Á¤ÇØÁø ½Ã°£¿¡ Á¤±ÔÀûÀ¸·Î ½ÇÇàµÈ´Ù.(½Ã°£Àº ±º´ë½Ã°£ÀÌ´Ù)
root crontab file
/etc/cron.d/logchecker - /var/cron/log°¡ ÃÖ´ë È­ÀÏ Å©±â¸¦ ÃÊ°úÇÏ´ÂÁö¸¦ ÆÇ´ÜÇÏ°í, ¸¸¾à ÃÊ°úÇÏ¸é ³»¿ëÀ» /var/cron/olog·Î º¹»çÇÑ´Ù.
/usr/lib/newslog - syslog daemon¿¡ ÀÇÇؼ­ /var/adm µð·ºÅ丮¿¡ »ý¼ºµÇ´Â log fileÀ» û¼ÒÇÑ´Ù.
Controlling crontab Access
cron utility¸¦ Á¦¾îÇÏ´Â µÎ°³ÀÇ file
/etc/cron.d/cron.allow
/etc/cron.d/cron.deny  

User Access
* ¸¸¾à cron.allow fileÀÌ Á¸ÀçÇϸé, ±× file¿¡ ÀûÇôÀÖ´Â user¸¸ÀÌ crontab ¸í·É¾î¸¦ »ç¿ëÇÒ ¼öÀÖ´Ù.
* ¸¸¾à ÀÌ fileÀÌ ¾øÀ¸¸é crontabÀº cron.deny fileÀ» üũÇؼ­ user°¡ crontab ½ÇÇàÀ» ±ÝÁöÇÒ Áö¸¦ °áÁ¤ÇÑ´Ù.
* ¸¸¾à µÑ´Ù ¾øÀ¸¸é crontabÀº root¸¸ ½ÇÇà½Ãų ¼ö ÀÖ´Ù.
* daemon, bin, smtp, nuucp, listen, nobody, noaccess fileÀº crontab »ç¿ëÇÒ ¼ö ¾ø´Ù.
* cron.allow fileÀº user°¡ ¸¸µé¾î ÁÖ¾î¾ßÇÑ´Ù.
The crontab Command
crontab ¸í·É¾î´Â crontab fileÀ» ¼öÁ¤, »èÁ¦, ÆíÁýÇÒ ¼öÀÖ´Ù.
crontab ¸í·É¾î´Â user¿¡´ëÇÑ ÀÔ·ÂÀ» /var/spool/cron/crontabs/username¿¡ ÀúÀåÇÑ´Ù.
root ¸¸ÀÌ ´Ù¸¥ userÀÇ crontab fileÀ» Àаí ÆíÁýÇÒ ¼öÀÖ´Ù.
rootÀÇ crontab fileÀº /var/spool/cron/crontab/root ÀÌ´Ù.
The crontab file format
crontab fileÀº °¢ entry¸¶´Ù ¿©¼¸°³ÀÇ field·Î ±¸¼ºµÇ¾îÀÖ´Ù. °¢ Çʵå´Â space ³ª tabÀ¸·Î ±¸ºÐÇÑ´Ù.
5      4      *      *      6       /usr/lib/newsyslog
ºÐÇʵå(0, 59)  ½Ã°£Çʵå(0,23)  ÀÏ/¿ùÇʵå(1,31)  ¿ùÇʵå(1,12)  ÀÏ/ÁÖÇʵå(0,6)  ¸í·É¾î¶óÀÎ  

óÀ½ ´Ù¼¸ Çʵå´Â ´ÙÀ½ Æ÷¸ËÀ» °¡Áø´Ù.
n    n°ª°ú ÀÏÄ¡
n,p,q    n,p, or q¿Í ÀÏÄ¡
n-p    n°ú p »çÀÌÀÇ °ª°ú ÀÏÄ¡
*    Ç×»ó ÀÏÄ¡  

 
How to Edit the User's crontab file
 
1. ±âº» Editor¸¦ ¼³Á¤ÇÑ´Ù.
$ EDITER=vi
$ export EDITOR  

 
2. crontab fileÀ» ¼öÁ¤ÇÑ´Ù.
$ crontab -e
20 15 * * 5 /usr/bin/banner "TIME TO GO!" > /dev/console
0 0 * * * /usr/bin/tar cvf /dev/rmt/0 /export/home/rickyd
:wq  

 
3. ÇöÀçÀÇ crontab fileÀ» º»´Ù.
$ crontab -l  

Modify Delete Post Reply Backward Forward List
Powered by Kang Jul Ki