2024-08-09

DirectoryPulse - Other documentation

 
DirectoryPulse! is a backup program for Windows computers and was written and tested with Windows 11.  The program should work with older versions of Windows.  

See this article for a general description and download instructions: DirectoryPulse Introduction

keyliner's DirectoryPulse program is free to download.  No registration.  No spyware.  No installation. 

DirectoryPulse works like this. 

  • From the main landing page, add one or more top-level folders to backup
  • Click "Refresh Directory Listing" to get a report
  • Click the Gear Icon
  • Use the Presets to assemble a destination path, and to pick the type of backup.

  • Click Apply
    Optionally, click "Save" and save the preferences for later re-use

  • On the main panel, click "Backup"


Saved Preferences can be re-retrieved, making a repeatable backup.  This can be scheduled and automated.  


First-Time/One-Time Recommended Setup
:


On first-time launch, a "SystemDefaults" panel is displayed. 

The program was written with C#, .DotNet 8.0. When first launched, you may be prompted to install Microsoft's .DotNet 8.0 libraries.

A.  Change the default PRESET destinations to match your local drives.  For example, if you have a D:\ Drive, you can use it for quick, local backups.  The destinations are optional but recommended

There are three major types of destinations:

1.  DefaultLocal (typically Drive D:; can be an external USB drive)

2.  DefaultSAN (local Network Drive, Synology, etc.  Can be a USB drive. Disable with the word "none" -- or just ignore.)

3.  DefaultCloud (typically OneDrive or GDrive)

Type, browse, or drag-n-drop a root path for each destination -- pointing to a pre-built top-level folder, such as "D:\Backups".  Details below.

 

- Change DefaultLocal 

Set to a local backup drive.
Typically a "D:\" or USB drive. 
A root-drive plus a subfolder is required: for example:  D:\backup 

If a second drive is not available, build a dedicated sub-folder on the C: drive  (C:\backups\). 
(This is not ideal because it does not protect you from drive failures.) 

A DefaultLocal is required, even if this is a dummy location.


- Change DefaultSAN

Set to a Network-aware SAN drive, an external USB, or other resource for longer-termed backups.  Even though this choice says "SAN", any path can be used.  When pointing to this device, typically use a UNC\share-name or a mapped drive.  External USB drives can also be used. 

Examples:

DefaultSANBackupDestination  = \\SynologyNAS\Data\Backups
   or
DefaultSANBackupDestination  = E:\Backups   or
DefaultSANBackupDestination  = \\PC-2\share\Backups  or
DefaultSANBackupDestination  = NONE
to disable

The destination requires a root drive and subfolder (e.g. \Data, or Data\Backups).  Backups cannot be written to the root of a drive. 

Note:  if you are not authenticated to this drive, or the drive is offline, setting this field is slow as the program attempts to navigate and test the path.  Be patient.  The offline drive will time-out.  You can continue to build a non-existent paths, on the chance they are available later.


- Change Default Cloud  

Typically point to a OneDrive or GDrive local folder

Examples:

DefaultCloudBackupDestination =  C:\Users\<username>\OneDrive\Backups
"None" to disable

Gdrive's location is:  
DefaultCloudBackupDestination = C:\Users\<username>\AppData\Local\Google\DriveFS\backups

Replace <username> with your Windows 10 username or browse the Users folder (or leave text as a literal "<username>" and let the program determine the folder).  An active OneDrive (or GDrive) account is required.  A subfolder, such as "backups" is required.

Use the Cloud destination for offsite backups. When the backup job is built, the backup can (perhaps "should be") set with the [x] Zip option.  This improves file-transfer times and reduces disk quotas.  (Typically, these destinations do not use dated-folders or generations - just because of disk quotas; an option controllable during the backup.)

Continue with these other System Preferences:

d.  On the same System Default panel, the "Default Subfolder" field shows a comma-delimited list of recommended subfolder names.  These are cosmetic names that help build the assembled destination path.  Review the list, adding or subtracting entries. 


This is a comma-separated list, defaulting to:  Projects, Daily, Weekly, Monthly, Adhoc, Test.  Selecting "Projects, Daily, Weekly...." does nothing more than appends a common, predicable name to the already-typed destination path.  The assembled path can be overrode and changed by re-typing the destination's path. 

Click SAVE and close the SystemDefault panel.


During the Actual Backup
-------------------------------------------------------------------

Naming the Configuration Settings:

During the actual backup (the "Gear" icon -- see previous article for how this looks), the job can be named and saved. This way the same backup, with the same settings, can be launched at any time. 

There is an art to naming the configuration files -- name the files in a way that makes sense to you when looking at them a month later. 

Here are the names I am using:

Local-AllData-Dated.ini
Local-Util-Dated.ini
OneDrive-Projects.ini
OneDrive-Projects-Compressed.ini
OneDrive-ProgrammingBook-Compressed.ini
SAN-AllData-Dated.ini
Test.ini


When named and saved, the configuration files are saved as clear-text in
C:\Users\<you>\Prefs\DirectoryPulse\iniFiles

These are simple ascii text files and can be edited, deleted, and renamed at will from within File Explorer.  There is nothing magic here.  (The Config-file select icon also has a context-menu for manipulating the files within the program.)


Gear Details:
-------------------------------------------

Backup Types:

From the configuration panels (the gear icon), choose the backup type, where I typically use "Dated Folder":









 



Dated Folders:


Dated-folder makes a full backup of every file and subdirectory in the selected paths.  The entire backup's path and structure is re-created within the dated-folder. 

D:\Backups\myProject\2024-0801\(C:\)Data\subfolder\deeper-folder\way-down-deep   etc.

This type of backup allows you to go back in time and recover older versions of the file -- or entire subdirectories, but the backup is relatively slow -- having to make a copy of each file, each time the backup runs. 

The option, [x]Limit Dated Backups keeps 10 dated generations of backups -- ten versions of the entire disk structure.  On the 11th generation, the oldest folder is auto-deleted, making for a self-cleaning backup.  This is the type of backup I use the most often.  Be aware this type of backup can occupy considerable space on the backup drive.

Click for larger view

To preserve a backup (to keep it from self-cleaning), use File Explorer to rename the dated-folder to a different, non-date-like name.  For example:  Hold-2024-0801


Generational Backups:

This is the fastest backup and is similar to traditional "Differential Backups".  Only one folder structure is built.  The first-time backup is slow -- having to backup every file in the structure.  Subsequent backups only backup changed files.

When a changed file is detected, the older version of the file is renamed and the new version arrives -- first in the stack:

For example: 
myFile.xlsx      -- the most current version
myFile-#01.xlsx  -- the previous version (from the last backup)
myFile-#02.xlsx  -- the next oldest version

On the 11th version (the 11th edit), the oldest is discarded.

With this type of backup, a backup-subdirectory might contain 10 versions of the same file; each dated.

Because this backup only backs-up 'changed' files, it is a faster backup.  But because the generational-files "intermingle" in the same folder, recovering an entire folder is messier.  This is really meant for small-volume recovery.  Use this for "transactional backups" -- small data-folders with volatile files -- word processing documents, spreadsheets, and the like.

This type of backup can take significantly less space than the Dated-Folder backups.

Added benefits:  If a file is deleted from the original (Source) drive, older versions of the file remain in the backup-set and can be manually recovered.  In other words, older generations of the file remain "forever" in the backup. 

If the folder has 'lots-of' delete activity, the deleted files continue to occupy space in the backup.  The deleted files can be recovered by manually deleting the entire backup structure and starting over -- at the risk of losing other generational backups.  If you do this, make an immediate new backup as soon as possible.  Perhaps, some day I'll write an "orphan cleanup routine."


Zipped Backups:

Zipped backups are full-backups (no #generations), but the entire folder is backed-up as a ZIP file.  The Zip backup is typically used for OneDrive/GDrive/AWS backups and the zip-files take obviously less space and less time to transmit. 

For example:
C:\Data\subfolder1\50-files
becomes one zip file:  D:\backups\deepstorage\Data\subfolder1\subfolder1.zip

C:\Data\subfolder2\400-files
becomes  D:\backups\deepstorage\Data\subfolder2\subfolder2.zip
 
This is meant for archival backups.  In a disaster, recovery is by folder, one folder at-a-time.  This is not ideal if an entire disk is lost, but is useful for recovering relatively small number of individual files or folders.

-------------------------------------------------------------
Other switches:

[x] "Auto-Run"

Auto-Run is intended for command-line or Windows Task Scheduling, and is required for tasks called by Windows Scheduler.  This switch allows the backup to run unattended.  This switch means "run unattended" -- with no prompting, and the program auto-closes when done. 

Scheduling Backups:

Use the Windows built-in "Scheduler" to schedule periodic backups: See Microsoft documentation for details.  In summary:  Click Start, Run, "Task Scheduler".  Pass command-line parameters when launching, see next. 

Command Line Parameters:
DirectoryPulse can be launched from a command line with optional parameters to automate backups.  Or a desktop (shortcut) icon can be built with these same parameters.

By passing a previously-built preference file (ini file) from either a Shortcut, Windows Start Menu Tile, or from Windows Task Scheduler, tasks can be fully automated.  For example:

C:\Program Files\Util\DirectoryPulse.exe ini=MyFavoritebackup.ini

where: 

MyFavoriteBackup.ini is the name of a previously-saved DirectoryPulse Preference file
[x]Auto-Run should be (must be) flagged in the INI file

When launched with a Preference/INI file, the program loads, retrieves the preferences, scans the directories, and launches the backup.  When the backup completes, the program auto-closes.  Log files record the transaction.  Automation requires [x]Auto-Run as one of the switches inside the preference file. 


[x] Delete Path before Backup


This switch deletes the entire destination folder prior to running the new backup.  This is a brute-force switch and can only be used with "SIMPLE" backups.   Other backups, such as "Dated" backups, self-clean and do not need this setting.  With Generational backups, this switch is illogical and cannot be selected.

[x] Discard Cache Directories

Recommended.  Discards obvious cache directories in Firefox, WordPerfect, and other such programs.  The list of discardable directories and keywords is adjustable -- see the SystemConfig.ini file.

[  ] Allow System Files

Allows backups in directories such as C:\Program Files, C:\Program Files\Common Files.  This is not particularly recommended.  Using this switch will backup the files, if they are in the "SourcePath" list, but it does not backup Registry or System DLL's that might be required.  This is a typical restriction for installed programs.

[  ] Use last  DOS Inventory

Mostly used for diagnostics and this switch should not be used.  Under the hood, when clicking "Refresh Directory List", the program writes a DOS DIR - an ascii DOS Directory /s listing which shows the source paths.  A report is written as a temporary file (see users\prefs).  This checkbox says to keep the previously-built report and do not re-inventory.

Other files:

When first launched, DirectoryPulse.exe creates several files in
C:\Users\<username>\prefs

In here, find small control (.ini) files, optional reports, and log files.  In this same area, note the file "dirCreate.txt" -- this is created when "Refresh DOS Directory Listing" is clicked.  Of interest, this is nothing more than a DOS DIR listing, which uses this command:

dir (a directory name/*.*) /-C /N /oG /S >C:\Users\...\dirCreate.txt

This is the input file used by the backup program.  Basically, if DOS can see the file, DirectoryPulse can work with it.

SystemConfig.INI
Contains global settings, including destination paths, and discard directories.
This is a simple ascii text file and can be edited with care.
If you screw-up this file, see the nearby "controlFileBackups" folder or simply delete the file to start over.

Log Files:

ASCII-text log files are found in
C:\Users\(your name)\Prefs\DirectoryPulse\Logs 

The (15) most-recent logs are kept.  This count is not adjustable.

Easter Egg:  Hover the mouse here.

Restores:
 
DirectoryPulse uses simple file copies and the backups live in a folder-by-folder reconstruction on your source files.  To restore a file or folder, use File Explorer to copy that file/folder back to the source drive.  This program does not help in the restores.  Perhaps a later version.

To recover a generational file (e.g. testfile-#01.xlsx", copy the numbered version and then manually rename, removing the -#00 appendage.  Because some files may have more than one version, updated on different dates, restores are not automated.  

Other Comments:

DirectoryPulse is not an image backup and cannot be used to recover a crashed hard disk.  Instead, it is meant to keep operational copies of data, which can help recover from spreadsheet-blunders, ransomware, viruses, etc.

DirectoryPulse is not meant to backup Windows System folders, or ProgramFiles and it actively avoids these areas.  In any case, restores from program folders would be flawed because of Registry and other concerns. 

However, from the Settings panel, "[x] Allow System Files" will attempt to backup C:\Program Files, and similar folders -- if they are in the backup-list (Source Process Paths) -- but in no case will it fiddle in the C:\Windows folders.  This is by design.

OneDrive files:

DirectoryPulse sees and inventories OneDrive files -- especially if "MyDocuments" is in the backup path -- but this program avoids off-site pointers.  In other words, if OneDrive has a pointer to an off-line file, DirectoryPulse skips that file, even if it is in the backup path, and even if the file were marked as "changed."  (See Users\YourName\OneDrive).

The reason:  A backup of an off-site OneDrive file would cause it download and expand locally on your PC.  This could be gigabytes of network and disk activity.  DirectoryPulse assumes Onedrive is adequate and it will ignore the file.  

But, if the OneDrive file has already downloaded and expanded locally, and it is in the backup path, DirectoryPulse will back it up -- assuming the file has had a recent change.  This does not incur any extra overhead from the network or disk gods.


Backup Thoughts:

With any backup strategy, it is wise to make Offline or Near-Offline backups -- backing up to an external USB drive -- then disconnect the drive.  In the event of a ransomware attack (where every file, every drive, every SAN, is encrypted, that drive would be safe.  

Consider offsite backups.  Consider .ZIP backups.


Slow Backups to USB devices:

DirectoryPulse does nothing special when writing to the backup drive -- the technique is similar to an xcopy or robocopy. 

I have found some USB disks -- particularly "thumb drives" -- are painfully slow -- especially if the backup set is large.  The slowness is regardless if DirectoryPulse is being used or not.  This is a gnarly problem and seems best resolved by not using that type of device.

See this article for hints on how to improve this.
https://keyliner.blogspot.com/2010/07/acronis-2010-usb-drive-backup-speed.html


Preference File Location:
C:\Users\<login>\prefs\DirectoryPulse

Log File Location:
C:\Users\<login>\prefs\DirectoryPulse\Logs

--------------------
This program was a blast to write, and I use it daily.  I hope you enjoy using it too.  Your comments are welcome. 

Related Article:
DirectoryPulse Introduction
USB Drive Backup Speed Slow







No comments:

Post a Comment

Comments are moderated and published upon review. (As an aside, not a single spam has been allowed through; why bother?)