Use the rsync to back up all files
Posted on 2010-11-15 14:22 MichaelCao 閱讀(268) 評論(0) 編輯 收藏 引用 所屬分類: Small thingsHere 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:
After that, add an alias into your .bashrc
alias bp='. ~/backup.sh'
So you can run bp directly to backup all things.
Over ~~~
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 ~~~