Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- local_dir="$HOME/backups/$(date +%U)"
- mkdir -p "$localdir"
- # '-a' for archive '-z' to compress transfer
- rsync -az username@remote_host:/home/username/dir1 $local_dir
- #if ssh is using non-stardard port
- #rsync -avz -e 'ssh -p 8022' username@remote_host:/home/username/dir1 $local_dir
- #to exclude folder use --exclude <folder_name>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement