Click here to Skip to main content
13,189,884 members (51,380 online)
Click here to Skip to main content
Add your own
alternative version

Stats

16.8K views
1.2K downloads
21 bookmarked
Posted 24 Jan 2015

A Lightweight File Backup Manager

, 24 Jan 2015
Rate this:
Please Sign up or sign in to vote.
A file backup manager with simple user interface and all the essential functionalities.

Introduction

An opensource Fle Backup manager with simple user interface and with all the essential functionalities for a home or regular office user. It contains two modes, first for folders and a second one for files.

Background

Well, saying about the birth of this application, for me it started as a project for personal use and then kept maintaining and enhancing for the last two years. I use this in my home desktop and laptop to sync important data to my network drive. I also use this with Google Drive to automatically backup important files and folders. Once application copies the files to my Google Drive folder, it will be uploaded into cloud. You have a laptop or desktop with SSD then configure this app since SSDs crash on you without any warnings. This will save you from losing all your loved files one day at no cost. And of course, I added some unique functionalities to this application. See it by yourself.

Using the Application

Screenshot: Homepage

Screenshot: Add Job Window-Folder Mode

Screenshot: Add Job Window-File Mode

Installation

Method 1: Just copy the build folder to the location you want and run from there.

Method 2: Use the installer setup file from $\FileManagerToolSetup\FileManagerToolSetup\Express\DVD-5\DiskImages\DISK1".

Optional: Once installation is done, go to the install location and modify FileManagerLibrary.dll.config settings "UserContext" to which section you want. Refer to comments in config file for more detail.

Windows service will install during first startup of the application, which require administrator privileges to run. Separate services can be installed based on configuration specifications.

Due to service control behavior of application, it is recommended to have administrator privileges for those who manage the application.

Application Features

I will also list some of the features included in the application.

  1. Folder Mode - Select a folder to take backup of the whole folder to another location. You can exclude subfolders if you do not want to take backup.
  2. Files Mode - Select file(s) to be backed up to a common location. Schedules include monthly, weekly, daily, and also an instant one where the files are backed up as soon as they are updated.
  3. There is an option to include backup only from a certain period in past. For my case, I want to take backup of a folder but do not want to backup files that created today, since I might delete those and do not need them to be backed up.
  4. There are three operation modes. Say you can use delete mode to delete files which are older than a specific date or delete the files when it grows beyond a specific size.
  5. Cleanup Destination option in folders mode will copy the files from source but it will keep the files in backup location until the specified days. Default is 0 which will delete the files from destination if they are missing in destination. This is available only in copy mode.
  6. You can have multiple version of files in files mode.

About the Code

I haven't focused on any specific framework or patterns during design of this application. However, you will be able to find many patterns here since, while designing they snap into place automatically for those have the patterns in mind.

Also it might not be a good idea to list out each and every class and methods here since it will make a mess and do more harm than good. The project is big enough and complex to explain it fully in an article. I will explain the code in top level for your primary understanding. If you want to have a deep dive, you are welcome to download and explore. Takeout any code as you like.

File Manager modules can be grouped as below:

  1. FileBase: Group of classes which performs the file system related operations of the application.
    CopyFolders/MoveFolders/Deletefolders: Copies/deletes/moves all the folders and its contents to destination folder. This method contains handling for exceptions and wait on separate thread in case or errors like file locked for some time.
    Class Files: FileOperations.cs, FileSystemOperations.cs
  2. FileWatcher: This module is designed around FileSystemWatcher class and watches files for modifications. It is written to scale up for huge amount of files in one batch job like watch for files in C:\windows\system32\.
    Class Files: FileWatcher.cs, FileWatcherManager.cs
  3. JobManagers: There are two type of jobs in the application. Interval based make use of Threading.Timer and File change events based which make use of Filewatcher.
    Class Files: FileWatcherManager.cs, ScheduledJobManager.cs
  4. Serialization: This class takes care of saving the application data into binary files.
    Class Files: FileWatcherManager.cs, Serializer.cs
  5. UIData: These classes hold all the UI data for the application and also leaf level methods for serialization of data.
    Class Files: BackupJobData.cs, FileJobSettings.cs, FolderJobSettings.cs, LastRunStatus, UIDataBase.cs
  6. WindowsService: This section handles the Windows service related functionalities. That includes API calls for changing Windows Service mode, Start and stop a Windows service and install and uninstall Windows service.
    Class Files: ServiceStartupTypeHelper.cs, WindowsServiceHelper.cs, WindowsServiceInstallHelper.cs
  7. Config: The backup can be performed from the application in two ways, from main Dashboard and Windows Service. To make best use to code and minimize maintenance, I had to move all the business logic to a single assembly and then consume the library from both. This added technical difficulties of getting the application configuration, since I need to keep separate copies of application configurations for Windows service and desktop module. The resolution was to create a custom configuration section, which proved to be a much better approach in maintenance perspective.
    Important Class Files: AppSettings.cs, FileManagerLibraryUserSettings.cs
  8. Jobcontroller: This is the module which is responsible for operations for each job.
    Class Files: JobController.cs
  9. UI - BackupSetManager: This UI module handles the adding and editing of jobs. There are two modes of jobs and each mode is having separate controllers which inherits from a base controller.
    Class Files: BackupJobManagerControllerBase.cs, FileManagerController.cs, FolderManagerController.cs, BackupJobManagerView.cs
  10. UI - Dashboard: This is the startup and main user interface of the application.
    Class Files: DashBoard.cs

Future Expectations

  1. You might see a WCF version of this where I am planning to run the service on a remote machine. Think this might be handy in case of office environments.
  2. Planning to convert it to WPF, but require lot more time on that....so I kept it for another day...
  3. Move the binary save files to XML to enable manual editing and better portability.

History

  • 22/Jan/2015: Original version. Please leave me comments on bugs. I will fix those as I get free time, based on criticality

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

shijo joseph
Technical Lead
United States United States
Started Programming career with VB 6 and VC++ and now Into .Net Development. Working with .Net since its first release (Version 1.0 Beta). Lucky enough to continue always with most updated versions of .Net and as of now; May 2007, fighting with .Net 3.0 (WPF,WCF...etc) and it's next most anticipated version LINQ.

Got familiarity up on the .Net Technologies and Guidelines like CAB, and Patterns and Practices, Enterprise Library and now with it's WPF version etc.

Specialized in Windows and Distributed and Service oriented applications.

You may also be interested in...

Pro
Pro

Comments and Discussions

 
QuestionNot compatible with Windows 7 Pin
Member 1254803626-May-16 4:05
memberMember 1254803626-May-16 4:05 
AnswerRe: Not compatible with Windows 7 Pin
shijo joseph26-May-16 14:20
membershijo joseph26-May-16 14:20 
GeneralRe: Not compatible with Windows 7 Pin
Member 125480362-Jun-16 7:42
memberMember 125480362-Jun-16 7:42 
GeneralRe: Not compatible with Windows 7 Pin
shijo joseph2-Jun-16 16:34
membershijo joseph2-Jun-16 16:34 
GeneralRe: Not compatible with Windows 7 Pin
Member 125480364-Jun-16 14:07
memberMember 125480364-Jun-16 14:07 
GeneralMy vote of 5 Pin
Anurag Gandhi26-Jan-15 1:38
professionalAnurag Gandhi26-Jan-15 1:38 
QuestionDownload don't work Pin
descartes25-Jan-15 3:06
memberdescartes25-Jan-15 3:06 
AnswerRe: Download don't work Pin
shijo joseph25-Jan-15 3:56
membershijo joseph25-Jan-15 3:56 
GeneralRe: Download don't work Pin
descartes25-Jan-15 4:34
memberdescartes25-Jan-15 4:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.171016.2 | Last Updated 25 Jan 2015
Article Copyright 2015 by shijo joseph
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid