Skip to Content

The Perfect Backup Solution, part 1: CYGWIN

Introduction

I know, having a title like this one is pretty challenging staff. Anyway, 12 years ago I firstly approached a computer, mainly intrigued by its possibilities in music recording. Since the beginning, I realized the importance of a good, solid, reliable - in other words, PERFECT BACKUP.

Through all these years, working on Windows and then Linux, I tried numerous backing software that somehow didn't do the job the way I wanted it. Till finally yesterday, I realized that I have made the full circle and came to the final solution, both for offline (hard-disk) and online backup.

What is perfect backup for me?

  • Linux and Windows compatible
  • to be able to have a perfect, reliable copy of my data offline and online
  • the data should NOT be comppressed (thus instantly accessible)
  • the (online) transfer and storage should be secure
  • is affordable -  I am talking about 1TB of important data.

In the next few articles I am going to talk about RSYNC (offline) and LFTP (online) backup solutions. Both of these are great, Linux based, open source software programs. What was lacking for me, was their implementation on a Windows OS.

Then, I fully realized the mighty power of CYGWIN. Cygwin is a platform that lets you run Linux apps on Windows.
In order to use Rsync and LFTP on Windows, one must learn the art of installing and configuring these programs through Cygwin.

Before I get to Cygwin, a quick note: both Rsync and LFTP are command-line programs. They have no windows, no GUI. They run from a terminal (console) where we input a command in a text sequence and hit Enter to execute it.

Cygwin - the Linux killer app in Windows

I came across Cygwin a few times in the past. Especially when I wanted to implement the Rsync software on a Windows machine. Somehow, rushing through forums, I didn't take the time to read enough so I didn't quite understand what it does.

And then, the 'penny dropped', as the English would say.
"Cygwin is a collection of tools which provide a Linux look and feel environment for Windows" (quote from the Cygwin website).

In other words, when you are installing Cygwin, you are actually installing a Linux-like console (terminal) on Windows OS and you are activating one or more pre-configured Linux programs to run through that console.

As a Linux user, familiar with the ways that Linux apps work, this is great (old) news. I can run some of my favourite Linux-console apps on Win.

As a Windows user, this is good news as well: Cygwin will let you use some remarkable Linux apps on your OS.

Two Linux apps that I find irreplaceable are RSYNC and LFTP (I tend to repeat myself, don't I?:-).
In Linux, both programs are pre-installed in most distributions. If they are not, install them via your software manager.
In *buntu systems, simply type: sudo apt-get install rsync lftp

For Windows, we need Cygwin to do that for us.
In the example below, I will try to explain the simple way of installing the two programs on Windows with the support of Cygwin. I will install LFTP with the support of SSH (for SFTP transfer).

Installing Rsync via Cygwin (Windows):

  • Download the Cygwin setup file (setup.exe) from their website.
  • Double click the downloaded “setup.exe” file
  • Check the options in the next few installation screens (default options are just fine)
  • Finally, a bigger white window appears with software list on the left side grouped by category: Accessibility, Admin etc.
  • On the left top corner, there is a search-box.
  • Type in: rsync. Three results should appear, in the Devel, Libs and Net groups.
  • Click the plus (+) sign next to the Net group. The version, name and description of the software will appear.
  • Click the two empty check-boxes (binary and source) and click Next.
  • Cygwin will now download and install Rsync for you.

Installing LFTP via Cygwin (Windows)

  • Follow the first 5 steps from the example above
  • Type in: openssh (I will explain later why we need this).
  • One result should appear, in the Net group.
  • Click the plus (+) sign next to it. The version, name and description of the software will appear.
  • Click the two empty check-boxes (binary and source).
  • Now type lftp in the search box. The same procedure as above applies.
  • Click Next
  • Cygwin will now download and install LFTP with SSH support (SFTP).

Now that we have Rsync and LFTP installed and ready to roll via Cygwin, it's time to solve the great mystery: Windows versus Linux drives and directory names.

In Linux, it's as simple as the internet: typing /home/viktor/docs in a file browser will take me to my "docs" folder.

Windows, on the other hand, uses back-slashes and even colons for the drive name: C:\users\viktor\My Documents.

How is this solved in Cygwin?

With implementing the CYGDRIVE sequence. To tell Rsync that we need to go to the C:\users\viktor\My Documents directory, we write: /cygdrive/c/users/viktor/My Documents/. As spaces are tricky on internet (and thus Linux, as Linux powers most of the Net), we use quotes: "/cygdrive/c/users/viktor/My Documents/".

So, C:\ disk becomes /cygdrive/c/; D:\ disk becomes /cygdrive/d/ etc...


In Part 2 I duscuss in detail the implementation of the RSYNC software program for the perfect offline (and sometimes online) backup.

No votes yet