Bash on windows: a great unix backup tool

rsync-wsl

I’m using the bash on windows (WSL) every day now to take a snapshot of my unix-based web sites.

Given that most people have a windows machine with a huge disk, WSL is a great way to take a snapshot of unix directories using a familiar interface – rsync/ssh.

Here is a line from a backup script that runs under bash under windows.

/usr/bin/rsync -avz --delete ec2-1-2-3-4.compute.amazonaws.com:/home/bitnami/htdocs/ ~/backups/

This asks rsync to copy a directory off an EC2 directory, and mirror it locally.

rsync will use a profile entry in the ~/.ssh/config file to provide the ssh certificate at run time in order to login and encrypt the rsync session.

Host ec2-1-2-3-4.compute.amazonaws.com
  IdentityFile ~/.ssh/ec2-secret.pem
  User ubuntu

This shows rsync which .pem file to use to login to the EC2 instance.

It doesn’t run as fast as a pure linux box would but certainly fast enough for my purposes.

Loving WSL !

Advertisements
Bash on windows: a great unix backup tool

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s