per perl galima butu paduoti ir password io::open3 "ejs" <ejs@no.where> wrote in message news:iqupvr$5g6$1@trimpas.omnitel.net... > > Laba, > pakritikuokit idėją: > RSYNC'inis sistemos backupas per SSH, galimas per N host'ų, leidžiamas per > CRON'ą > > Blogai tai, kad juzerių SSH raktus reikia laikyt be passwd. > > #!/bin/sh > > # save site settings to remote hosts > > declare -a REMOTE=(site1.tld site2.tld site3.tld ... siteN.tld) > declare -a RUSERS=(user1 user2 user3 ... userN) > declare -a DIRS=(/etc/ /var/log/ /var/backups/) > > PKEY_DIR=/var/sitesettings > SAFEPLACE=/sitesettings/`hostname -f` > > if [ ! -d $PK_DIR ]; then > echo Creating $PK_DIR; > mkdir -p $PK_DIR; > fi > > echo "Syncing ${#DIRS[@]} directories to ${#REMOTE[@]} site(s)" > > for ((i = 0 ; i < ${#REMOTE[@]} ; i++)); do > for j in ${DIRS[@]}; do > rsync -avl -e "ssh -l ${RUSERS[$i]} -i $PKEY_DIR/${REMOTE[$i]}" \ > --backup --backup-dir=.`date +%Y-%m-%d` \ > "$j" ${REMOTE[$i]}:"$SAFEPLACE$j" > done > done > > -- > ejs