# luckyBackup

luckyBackup is a a powerful, fast and reliable backup & sync tool.

This page provides information and support for the Windows port of luckyBackup. The current status of the port can be summed up with something like, “It mostly works and there is active development to improve it.” The Windows version of luckyBackup is not however 100% functional and there are known (and probably unknown) glitches and bugs with it. Please if you find any problems report them back to us so that we can get them resolved and make luckyBackup just as fantastic on Windows as it already is on Linux.

A side note! I'm brand new at using Qt and C++ is pretty sketchy for me since I haven't used C in years. So the “active development” means, a slow but steady progress.

Please reference http://luckybackup.sourceforge.net/ for more information about luckyBackup and other ports or distributions of it.

For support please use the luckyBackup forums on sourceforge if possible. Otherwise you may contact the author for general support or BMT Solutions for e-mail support of the Windows port (Phone support is not provided).

## My (Current) Build/Test Environment

• Windows 7 64bit
• Qt libraries 4.8.5 for Windows (minGW 4.4) Download
• Qt Creator 3.0.0 for Windows Downlad
• rsync 3.1.0 compiled under Cygwin with GCC
• OpenSSH 6.4p1-1 from Cygwin Installer

## Status

This is accurate for version 0.4.7 based on my testing. Please report any problems.

Feature Status
Local > Local Backup Works!
Local > Remote Rsync Backup Works!
Local > Remote Rsync over SSH Backup Works using an SSH Key.
Scheduling Backups Works! via Windows Task Scheduler
E-Mail Backup Report Works! via Blat
Windows VSS Options being tested.
luckyBackup snapshots Does not work correctly. Fix coming in future release.

• Currently recommended version. Includes rsync 3.1.0, ssh, blat (email), and vss tools/scripts.

# Install/Configure

## luckyBackup Installer Package

An installer package is being developed for the Windows port but is not yet available. Please continue to use the Manual method.

## Manual Installation

### Cygwin

NOTE: An alternate to this is using cwRsync. A free version is available here however the latest version can be purchased here for a modest price and includes support

Otherwise..

First you need Cygwin installed on your computer. You can download it from http://www.cygwin.com/. Once you have downloaded the setup.exe file you need to install both rsync and openssh. Below is a walk-through of images from when I installed Cygwin.

1. Run the Application, click Next.
2. Select Install from Internet, click Next.
3. Select install folder, click Next.
5. Select Connection type, click Next.
6. I just selected a handful of sources, click Next.
8. It might tell you this. Read it, click Ok.
9. Once you get here you can select the packages to install.
10. First, search for rsync using the search box, and expand Net, then click on rsync to include it.
11. Now, search for ssh using the search box, and expand Net, then click on ssh to include it. Click Next.
12. It will tell you about dependencies, click Next.
14. Select your options, click Finish.
15. If you added desktop icons, you should see them on your desktop. You're done with the Cygwin install.

### luckybackup

There's not a whole lot to installing luckybackup itself. Just download and uncompress the files into any folder you choose. There's no installer so you will need to create a shortcut if necessary on your desktop yourself.

I'll work on this more as I have time.

# HOW TO's

## Create SSH Key for passwordless SSH with cygwin

luckyBackup doesn't have a prompt to enter SSH passwords so you need to use a SSH key instead. Below is a very quick and basic guide to create a SSH key. I'm sure more advanced options exist :)

• Open the “Cygwin Terminal” by default this is located c:\cygwin\Cygwin.bat
• Create a ssh key
ssh-keygen -v -t rsa
• Press enter a few times (I think 3) until it completes, accepting all defaults.

This will create a key in the /home/username/.ssh/ folder of your cygwin environment and will be used by default when using ssh to connect to a system. You'll need to copy the id_rsa.pub file to the server you want luckyBackup to backup to and from there add it to your users keyfile. This might vary from system to system but here's an example adding it to a FreeBSD system.

• From the Cygwin environment you can use “scp” to copy the file to the target system.
scp ~/.ssh/id_rsa.pub user@host:key.pub
• Then, SSH into the target system and execute
mkdir -p ~/.ssh
cat ~/key.pub >> ~/.ssh/authorized_keys

## Scheduling Backup's via Windows Task Scheduler

On *nix platforms luckyBackup relies on the systems crontab scheduler. Since that does not exist on Windows the closest (Windows based) option is to use the Windows Task Scheduler. Unfortantly luckyBackup cannot currently configure the schedule for you so it must be done manually. Optionally you could configure crontab as a server through cygwin but I haven't had time to test and write instructions for that yet.

### Windows 7

1. To open the Windows Task Scheduler you can Click the start menu and type “Task Scheduler” in the quick search box. Then select the Task Scheduler from the results pane.
2. Click on the “Task Scheduler Library” in the left pane window.
3. (Optionally) right-click the “Task Scheduler Library and click “New Folder””
1. Enter “luckyBackup” or another descriptive name. Then click “OK
2. Now click on and select the “luckyBackup” folder (or whatever you named it) from the tree.
4. On the right side within the Actions pane click on “Create Task” or you may right-click on a folder tree item on the left pane (such as the luckyBackup folder) and click on “Create Task
5. Fill out the Name and Description boxes with anything that properly describes the backup task for you.
6. (Optionally) Click on “Change User or Group” to have the task run as a different user.
7. Select the option “Run whether user is logged on or not
8. Select the option “Run with highest privileges
9. Then click on the “Triggers” tab at the top of the Create Task window.
10. Click on “New
11. Adjust the settings to define the schedule for the task. I selected “Daily” and a start time of 8:00:00 PM
12. Click on “OK
13. Then click on the “Actions” tab at the top of the Create Task window.
14. Click on “New
15. Select “Start a program” from the Action dropdown list.
16. Enter the path to luckyBackup or click the “Browse” button to select the luckybackup.exe file.
17. Enter the path to the luckyBackup profile to execute in the “Add arguments” box which should be similar to the below example.
18. Click “OK
19. You may open the “Conditions” or “Settings” tabs and adjust any settings however for my example I left them at their default values.
20. Click “OK” at the Create Task page to finish creating the task.

### Windows Server 2003

1. To open the Windows Task Scheduler,
1. click on the Start Menu
2. click on the Control Panel,
3. click on Scheduled Tasks
2. On the first Scheduled Task Wizard page click Next
3. Next, click on Browse and browse to and select the luckybackup.exe file.
4. Define a task name and select from the schedule options. Then click Next
1. I set the task name to “System Backup” and selected “Daily” for this example.
5. Select a start time for the task and adjust any additional schedule options. Then click Next
6. Enter a useraccount and password that will be used with running the task. Be sure to supply an account with permission to access all files you intend to backup. Then click Next
7. Check the Open advanced properties for this task when I click Finish checkbox. Then click Finish
8. On the first Task tab of the System Backup window you can add the required arguments to the Run field which should be similar to the below:
9. Click OK to finish creating the task.

Placeholder :)

### Windows XP

Placeholder :)

##### notes

- Thanks Valerio

* At this point it only misses to close the program after the backup (it will open a new windows for each backup). If it was linux I would use pkill in 'Also execute/after' but, on windows, I don't think it's possible without getting crazy! What about adding a flag: 'Close luckybackup at the end'?

## Sending E-Mail's from Luckybackup

You can configure luckybackup to send e-mails via any command-line e-mail program. The windows version of luckyBackup includes a command-line tool for sending e-mail called “Blat”.

You can configure the command luckybackup executes when sending an email from the “Profile” menu then select “Email”.

### Using Blat

Blat is a Windows (32 & 64 bit) command line utility that sends eMail using SMTP or post to usenet using NNTP” that has been around for a pretty long time. It's a quick an easy solution to sending automated e-mails on Windows and works perfectly with luckyBackup.

#### Install Blat

Blat is now included in the windows installer for luckyBackup. It should be located within the sub-folder “blat” of the main luckyBackup installation folder.

Blat doesn't have an installer and it's what you could call a “portable” tool. Simply uncompress the downloaded file and copy it to a location of your preference. If you're unsure you can copy/move the contents of the “full” folder into your luckyBackup folder. Another option is to create a folder named “Blat” somewhere on your system and copy/move the files there instead.

You should have the following files:

• blat.dll
• blat.exe
• blat.lib
• blatdll.h

#### Configure luckyBackup

1. Open luckyBackup
2. Click on the Profile menu option
3. Click on the Email menu option
4. In the Command box enter the path/file of the blat executable and these parameters.
1.  c:\Blat\blat.exe - -f %f -to %t -s %s -server %v -attach %l -body %b
5. Fill out the from, to, subject, and smtp server fields on the luckyBackup form.
1. Note: You must have an SMTP server that will accept and deliver the e-mail.
2. You can use parameters -u and -pw to use SMTP AUTH with Blat
3. You can specify the SMTP port to use with the format smtp.domain.ltd:port
6. Click Test and after a couple of seconds you should get a dialog box with the command output and hopefully an e-mail.

#### Notes

For more information please reference the blat website. It has documentation and many examples that you can use for more advanced configurations of blat.

## Windows VSS

Being able to backup open/system files is sometimes very essential. Windows has support for Volume Shadow Copy service which is similar to filesystem snapshots on *nix platforms. However neither rsync or luckyBackup have built in support to utilize Windows VSS. There are a few ways to get this to work and currently the best and only simi-supported option is via pre/post scripts (see below).

### Pre/Post Scripts

NOTE: The Pre/Post scripts must be located in a folder not using any spaces in the name due to an issue with luckyBackup. This is a temporary issue and will be resolved. The included example scripts must be modified accordingly. –

You can create batch scripts that luckyBackup will execute before and after a backup. With this feature you can create scripts to create a shadow copy and expose it to a drive letter that luckBackup can then use when running the backup.

This isn't the most elegant solution but it does work. Example scripts are included with the windows luckybackup distrubution within a sub-folder “vss” of the main luckybackup installation folder.

You will need to modify these scripts to suit your needs and environment. They are configured for a Windows 7 environment and to create a shadow copy of drive C: then expose it to drive B:

So, you must modify the drive letters if you want to create a shadow copy of a different drive or expose that copy to a different drive letter. You must also change the vshadow command to the correct version if you're not using Windows7/2008.

Once you've done this. You can create a normal task within luckyBackup. Verify it works correctly then modify the task. Under Advanced then Also Execute you must add the pre-vss.cmd to the Before category then add the post-vss.cmd to the After category.

Then, you must change the Source path to use the B: (or whatever drive letter the shadow copy is exposed to) drive. This drive will only exist while the shadow copy is exposed and that only happens after the task begins execution. Because of that, you must also check the “by-pass WARNING” checkbox on the Advanced then Also Execute configuration page.

Now, when you run this task the pre-cmd.cmd will create and expose a shadow copy of your drive then the normal task will run making a backup from the exposed shadow copy. Finally, the post-vss.cmd will remove the shadow copy.

I'll work on providing step-by-step instructions with pictures soon :)

### Patched Rsync

There are patches floating the web that add VSS support to rsync and there's at least one person who's hosting a pre-built executable for windows with VSS patches.

Using this version of rsync you should be able to utilize VSS for your backups.

### Rsync Wrapper

You can create a custom wrapper to the rsync.exe command to get VSS support.

# Build luckyBackup on Windows

If you want to download the luckyBackup source and compile it yourself here are some basic instructions to get you started. This is what I use and there may be other (maybe ever better) methods. Please let me know if you notice an error or are aware of a better option

notice : this section is a work in progress :)

## Install MinGW 4.4

MinGW 4.4 needs to be installed on your computer first. Finding a copy of it has become a bit harder lately so I'm keeping a copy availble here on my website. You can download it here if you wish. Just extract the files into C:\MinGW or another path if you wish to use non-default locations for things.

## Install Qt 4.8.5

Pretty straight forward process. Download Qt 4.8.5 from https://qt-project.org/ then run the installer. I've just gone with the default folder paths.

## Install QT Creator 3.0

As with Qt itself this is pretty easy. Just download it from the Qt Project site and run the installer.

Download the luckyBackup source code from the main website http://luckybackup.sourceforge.net/

You can extract the source code to any work folder you want to use.

## Testing

It may be a good idea to test your build to make sure luckyBackup behaves correctly. I'm going to try and list a set of tests below that I'll follow myself with each build I release.

Test Status Result
Start luckBackup console-mode from Windows
Start luckyBackup GUI from Windows
Start luckBackup console-mode from Cygwin
Start luckyBackup from within Cygwin
Local to Local Backup.
Local to Remote Backup.
Local to Remote Backup over SSH.

# Reserved...

This space holds notes and information that may be incomplete, inaccurate, and unsafe to your health.

## Build the rsync-wrapper

There's a contributed rsync-wrapper we received that adds VSS support to luckyb. It's currently not available as a pre-built download like 0.4.7 is and may be included with 0.4.8 release. To build it you need Python and py2exe installed.

### Install Python

via this download http://www.python.org/ftp/python/2.7.3/python-2.7.3.amd64.msi 32 bit version is http://www.python.org/ftp/python/2.7.3/python-2.7.3.msi

1. Select “Install for all users” then click Next
2. Pick installation folder (I use the default) then click Next
3. Select/Deselect Python features (I used defaults) then click Next
4. A User Account Control (UAC) message might pop up asking for permission. Allow it.
5. Click Finish when the installer completes.

### Install py2exe

1. Run the installation package
2. First page, click next.
3. Next page, select the Python 2.7 install (was already selected for me) then click Next.
4. Next page, just click Next :)
5. One it completes click on Finish.

#### notes..

cx_freeze seems to be more active. Maybe we should try that? http://cx-freeze.sourceforge.net/

Another option is pyinstaller to look at http://www.pyinstaller.org/

### Build rsync-wrapper

• Open Command Prompt Window (start → run → cmd.exe or for Vista/7 start → cmd.exe)
• Add Python to your path with
set path=%PATH%;c:\Python27
• Change to whatever folder you are keeping the rsync-wrapper code.
cd \data\code\luckybackup\0.4.8\rsync-wrapper-win\
• Build the wrapper
python setup.py py2exe

A dozen or so lines will fly by and it will give you a notice about required .DLL files. The .exe file should now be compiled and executable on your system. The compiled version should be in a subfolder called “dist” along with a few other files.