Rsync Over SSH Configuration in Debian

来自开放百科 - 灰狐
跳转到: 导航, 搜索

Rsync Requirements

  • Rsync
  • Openssh
  • Cron

Debian用户

#apt-get install rsync

enable rsync in this file /etc/default/rsync

RSYNC_ENABLE=false  to   RSYNC_ENABLE=true
#/etc/init.d/rsync restart 

create key for the user

# ssh-keygen -t rsa 

use scp to get the file over to target machine

# scp ~/.ssh/id_rsa.pub root@remotehost
or
#ssh-copy-id -i ~/.ssh/id_rsa.pub root@remotehost

Rsync Example

#/bin/sh
echo backupstarted
/usr/bin/rsync --compress --verbose --rsh=ssh --times --owner --group --ignore-times --links  --perms \
                    --recursive --size-only --delete --force --numeric-ids --exclude-from=/etc/rsync.exclude \
                    --stats   /etc  root@target_machine:/home/backup/thismachine/
echo backupended

参考:http://www.debianhelp.co.uk/rsync.htm

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱