Posted on 2010-11-15 14:22
MichaelCao 阅读(257)
评论(0) 编辑 收藏 引用 所属分类:
Small things
Here is the scripts:
rsync --progress --avze ssh --delete srcDir/ remoteName@remoteMachine:remoteDir/
-a quick way to specify the recursion and preserve everything.
-v verbose
-z compress
And then change ssh with no password:
Create the private keys for local machine:
ssh-keygen -t dsa
Copy the local keys to remote machine:
ssh-copy-id -i ~/.ssh/id_dsa.pub remoteuser@remotebox
Do not set the password.
After that, add an alias into your .bashrc
alias bp='. ~/backup.sh'
So you can run bp directly to backup all things.
Over ~~~