GmailSync - Free automated backup solution using Gmail
Source Code for GmailSync is now available from CodePlex Gmailsync
Update ** Now with support for sub-directories and uploading files > 10 MB. See What's New.
What is GmailSync?
In short, GmailSync is "Blat" for "Gmail". Blat (http://www.blat.net/) is a win32 command line smtp client.
GmailSync is an automated backup tool to synchronize files on your computer to your gmail online storage. By using this, you can theoretically use almost unlimited amount of free space available on your gmail account.
Just imagine:
2.7 Gb * 99 (invites) = 267.3 Gb.
This tool is inspired by the article written on LifeHacker.
http://www.lifehacker.com/software/email/geek-to-live-automatically-email-yourself-file-backups-168156.php
How It Works?
GmailSync is little more than a simple email client. It uses another third party (free) program called Stunnel http://www.stunnel.org/ to wrap SMTP packets in SSL because Gmail SMTP server uses secure connections. For some reason, I am unable to get the EnableSSL property on SmtpClient to work. Stunnel is bundled with the download therefore you don't need to install or setup another other component before running GmailSync. GmailSync keeps track of the backed up files and only does differential backup the second time you run it.
Setting up GmailSync:
Setting up GmailSync is really really easy.
1) Download: Get GmailSync and extract it in any directory. This is developed with .NET Framework 2.0 therefore you may need to download the 2.0 runtime.
http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&displaylang=en
2) Installation: After extracting the contents from the zip file, just run the Install_Setup.bat file to register the stunnel service and start running it. It'll only take a second or two and then you'll see a little black computer in your taskbar tray.
3) Configure & Run: After installation, the only thing required is to configure the application. The common configuration parameters are source directory, Gmail username, Password.
The configuration settings are saved in the application configuration file, i.e. GSyncConsole.exe.config . Just open this file in notepad and there you can see all the configuration parameters and their default values.
-- Configuration File: GSyncConsole.exe.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<!-- The source directory for the backup -->
<add key="SourceDirectory" value="C:\Data"/>
<!-- Gmail dont' accept some extensions such as .exe or .chm. This parameter
is used to identify such extensions and then use the ValidExtension property
to rename the file before sending it to Gmail -->
<add key="InvalidExtention" value=".exe|.chm"/>
<!-- See the comments on InvalidExtension property -->
<add key="ValidExtension" value=".pdf"/>
<!-- GmailSync will automatically move the file to this directory after sending
it to Gmail. If you don't specify this directory then the file remains in
its original directory -->
<add key="DestinationDirectory" value=""/>
<!-- Used in the Subject of the email. It can be helpful in setting up a filter
on Gmail -->
<add key="EmailFilter" value="[backup]"/>
<!-- The sender of the email message -->
<add key="EmailFrom" value="yourgmailaddress@googlemail.com"/>
<!-- The receiver of the email message -->
<add key="EmailTo" value="yourgmailaddress@googlemail.com"/>
<!-- Smtp Server: Leave it as it is as we are using Stunnel as the SMTP gateway -->
<add key="SmtpServer" value="127.0.0.1"/>
<!-- Smtp Port: Leave it as 465 -->
<add key="SmtpPort" value="465"/>
<!-- The username to authenticate with Gmail smtp server.
For most cases, it is same as EmailFrom address -->
<add key="SmtpUser" value="yourgmailaddress@googlemail.com"/>
<!-- The password for the SmtpUser -->
<add key="SmtpPass" value="yourgmailpassword"/>
<!-- Ignore the following fields -->
<add key="CheckAndRunStunnelOnStartUp" value="true"/>
<add key="StunnelServiceName" value="stunnel"/>
<!-- Changes for Version 0.2 . If you are urgrading then only
copy the following configuration settings to preserve your old
settings -->
<!-- Set this to true if you would like to include sub directories -->
<add key="ScanSubDirectories" value="true"/>
<!-- Splits the file into following size if greater than 10 MB -->
<add key="SplitFileSize" value="5"/> <!-- In MB -->
<!-- Include the directory information into Email subject to distinguish between
same name files in different directories -->
<add key="FullDirectoryPathInSubject" value="true"/>
<!-- Allows you to run multiple instances for different directories.
If you set this, then you wont be able to preserve your
settings if you move the directory. -->
<add key="AllowMultipleInstances" value="true"/>
<!-- End of Changes for Version 0.2 -->
</appSettings>
</configuration>
Scheduling GmailSync for regular backups:
Currently there is no scheduling capability built into GmailSync therefore you may need to use Windows Task Scheduler to automate regular backups. The following script registers a task to run everyday at 1:00 am. You may want to change this file to run on any other time.
schtasks /create /tn "GmailSync" /tr "GSyncConsole.exe" /sc DAILY /st 01:00:00
More documentation on Scheduling tasks using Command line
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/schtasks.mspx?mfr=true
Download GmailSync (Latest Version)
What's Next?
In the next release, I am planning to add few more features like,
- GUI instead of command line and configuration file.
- File filters
- Any other requested feature??
Old Versions:
Only download this if the newer version is not working for some reason and you have overwritten your copy of GmailSync.
Download GmailSync 0.2
Download GmailSync 0.1
Vista update for "GmailSync - Free automated backup solution using Gmail" by: marc1990
The problem with vista is that it has to install service as administrator. And by run the script as administrator: he wil start in a other dir(C:\windows\system32).
The solve is simple:
1. You wil need administrator permissen
2. Then you have to edit Install_Setup.bat.
cd stunnel -> cd C:\autobackup\stunnel
3. Run the script with administrator permission