FTP를 이용해서 용량이 큰 화일을 다운로드받거나 부하가 많은 낮시간에 다운로드하는 것을 피하려면 스크립트를 만들어서 사용량이 적은 밤시간에 다운로드받는 것이 편리하다.
아래의 예는 매주 금요일 21:00에 Sunsolve Ftp Site에서 O/S Patch를 다운받는 방법이다.
=======
crontab
=======
#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 21 * * 5 /user/home/bslee/script/patchdown.sh
^^^^^^^^^
============
patchdown.sh
============
#!/bin/csh
cd /user1/ftp/pub/y2000
mv 2* old
mv 7* old
mv 8* old
cat ftp.cmd | ftp -n sunsolve.sun.com
=======
ftp.cmd
=======
user anonymous mycroft@initdata.co.kr
bin
prompt
hash
cd /pub/patches
mget 7_Recommended.zip
mget 8_Recommended.zip
mget 2.5.1_R*.Z
mget 2.5.1_y*.Z
mget 2.6_R*.Z
mget 2.6_y*.Z
bye
아래의 예는 매주 금요일 21:00에 Sunsolve Ftp Site에서 O/S Patch를 다운받는 방법이다.
=======
crontab
=======
#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 21 * * 5 /user/home/bslee/script/patchdown.sh
^^^^^^^^^
============
patchdown.sh
============
#!/bin/csh
cd /user1/ftp/pub/y2000
mv 2* old
mv 7* old
mv 8* old
cat ftp.cmd | ftp -n sunsolve.sun.com
=======
ftp.cmd
=======
user anonymous mycroft@initdata.co.kr
bin
prompt
hash
cd /pub/patches
mget 7_Recommended.zip
mget 8_Recommended.zip
mget 2.5.1_R*.Z
mget 2.5.1_y*.Z
mget 2.6_R*.Z
mget 2.6_y*.Z
bye