# # cron ¼³Á¤Çϱâ # - define : ƯÁ¤½Ã°£¿¡ backup ¶Ç´Â ½ÇÇà½Ãų ¸í·É¾î auto ¼öÇà * /usr/bin/crontab 1. cron command - Edit the user's crontab file # crontab -e 15 3 * * 1-5 find $HOME -name core 2>/dev/null | xargs rm -f - List the current crontab file # crontab -l 0 2 * * 0,4 /etc/cron.d/logchecker 5 4 * * 6 /usr/lib/newsyslog 15 3 * * * /usr/lib/fs/nfs/nfsfind 1 2 * * * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1 2. Control files for cron # /var/spool/cron/cron.allow # /var/spool/cron/cron.deny 3. crontab Entry Format minute (0-59), hour (0-23), day of the month (1-31), month of the year (1-12), day of the week (0-6 with 0=Sunday 15 3 * * 1-5 find $HOME -name core 2>/dev/null -------------> ¾ÕºÎºÐ ºÎÅÍ minute EX) * systemA : 4mm dat ¿¡ backup * systemB : HDD ¿¡ backup * systemC : target system -- system B ¿¡¼­ ÀÛ¾÷ --- # vi backup(HDD¿¡ backup) -> ¾Æ·¡¿Í °°ÀÌ edit echo " rsh systemChostname tar cvfb - 20 systemCdiretory | tar xvfbBp - 40 " rsh systemChostname tar cvfb - 20 systemCdiretory | tar xvfbBp - 40 echo " backup job THE END GOOD-BYE " :wq! # chmod 755 backup # cd /var/spool/cron/crontabs # vi root #ident "@(#)root 1.12 94/03/24 SMI" /* SVr4.0 1.1.3.1 */ # # The root crontab should be used to perform accounting data collection. # # The rtc command is run to adjust the real time clock if and when # daylight savings time changes. # 0 2 * * 0,4 /etc/cron.d/logchecker 5 4 * * 6 /usr/lib/newsyslog 15 3 * * * /usr/lib/fs/nfs/nfsfind 1 2 * * * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1 0 3 * * * /backup > /dev/console :wq! --> »õº® 3½Ã¿¡ data backup # reboot -------------------------------------------------------------------------------- -- system C ¿¡¼­ ÀÛ¾÷ --- # vi backup(DAT¿¡ backup) -> ¾Æ·¡¿Í °°ÀÌ edit echo " tar cvfb - 20 backupdiretory | rsh systemAhostname dd of=/dev/rst5 obs=20b " tar cvfb - 20 backupdiretory | rsh systemAhostname dd of=/dev/rst5 obs=20b echo " backup job THE END GOOD-BYE " :wq! # chmod 755 backup # cd /var/spool/cron/crontabs # vi root #ident "@(#)root 1.12 94/03/24 SMI" /* SVr4.0 1.1.3.1 */ # # The root crontab should be used to perform accounting data collection. # # The rtc command is run to adjust the real time clock if and when # daylight savings time changes. # 0 2 * * 0,4 /etc/cron.d/logchecker 5 4 * * 6 /usr/lib/newsyslog 15 3 * * * /usr/lib/fs/nfs/nfsfind 1 2 * * * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1 0 3 * * * /backup > /dev/console :wq! --> »õº® 3½Ã¿¡ data backup #reboot