backup AWS script using rsync and ssh

# rsync -av -e ssh directory_name [email protected]:/Volumes/disk/BK-svr-london # rsync -avz -e ‘ssh -i 遠端的KEY’ 遠端帳號@遠端IP:遠端目錄 近端目錄 # —— —— example: cat RUN_backup_aws.sh #/bin/sh /usr/bin/rsync -avz -e ‘ssh -i /home/xxx/_AWS/key_xxx.pem’ [email protected]:/etc /home/xxx/_AWS/BACKUP /usr/bin/rsync -avz -e ‘ssh -i /home/xxx/_AWS/key_xxx.pem’ [email protected]:/var/www /home/xxx/_AWS/BACKUP /usr/bin/rsync -avz -e ‘ssh -i /home/xxx/_AWS/key_xxx.pem’ [email protected]:/home/ec2-user /home/xxx/_AWS/BACKUP