rdist 스크립트

2012. 2. 5. 18:46개발/서버

서버와 클라이언트 두개 모두

hosts 설정

18.18.18.18         svr  #상대방 호스트

 

hosts.equiv 설정 (없으면 만들어줘라)

svr  #내가 rsh 허락해줄 호스트

 

$cat BnBrdist

 

#!/bin/bash
DNUM=`date +%w`
/bin/touch /home/bnb/lastbackup
/usr/bin/rdist -f /usr/local/BACKUP/bnb/Distfile.$DNUM

 

$cat usr/local/BACKUP/bnb/Distfile.0

HOSTS = ( kidcbackup )
TARGET = ( /data5/arsdb/bnb/0 )

SOURCES = ( /home/bnb )
EXCEPTS = ( /home/bnb/Distfile /home/bnb/.* )

(${SOURCES}) -> (${HOSTS})
    except (${EXCEPTS});
    install -R (${TARGET});