Queue'eM - Backup / Synchronize / Archive
by Quib Mask

Designed to be a simple utility to backup, synchronize or archive files.
Lacks any file deletion capability to provide as much file safety as possible.

[00]======================================================================================

.: Contents

[01] Quick Start
[02] Settings
[03] Explanation of Settings
[04] Command Line Switches
[05] Default INI File
[06] Disclaimer

[01]======================================================================================

.: Quick Start

Queue'eM reads its settings from Queue'eM.ini (in the same folder as Queue'eM.exe).
If Queue'eM.ini does not exist, Queue'eM will prompt you to either press OK to use default
settings or press Cancel to generate a default Queue'eM.ini and exit.

Default settings are:
Copy Mode: Backup
Decision Method: Checksum Difference
Source Directory: $EXEDIR (folder that Queue'eM.exe is run from)
Target Directory: $DOCUMENTS\Backup (User's My Documents folder\Backup subfolder)
Exclusion Rules: None
Inclusion Rules: None

[02]======================================================================================

.: Settings

In Queue'eM.ini, the settings are presented thusly:
[Queue'eM]
Mode=
Method=
SourceDirectory=
TargetDirectory=
Exclusions=
Inclusions=

Queue'eM.ini accepts the following entries (NOT case sensitive) for Mode=
Backup
Synchronize
Archive
Back
Sync
Arch
B
S
A

- While the entry is NOT case sensitive, it needs to be spelled correctly.
- An invalid mode entry will result in Queue'eM exiting with an error message.

Queue'eM.ini accepts the following entries (NOT case sensitive) for Method=
Blind
Checksum
Difference
Newer

- Technically spelling is irrelevant as Queue'eM only uses the first letter of the Method
  to determine what operation to perform, so B, C, D or N would work equally well.
- An invalid entry (not beginning with B, C, D or N) will result in the default Method for
  the chosen Mode to be used. A blank entry will also use the Mode default.
- Backup mode's default is Checksum, Synchronize's is Checksum and Archive's is Blind.

Queue'eM will use the folder listed by SourceDirectory as the folder to copy from.

Queue'eM will use the folder listed by TargetDirectory as the folder to copy into.

Queue'eM will ignore any file whose name or folder structure contains letters, numbers,
words or symbols listed by Exclusions unless overridden by an Inclusion.

- Seperate Exclusions with a space.
- Maximum of 10 Exclusions accepted.
- Wildcards (*, ?) are NOT supported.

Queue'eM will accept any file that has been excluded from being copied due to an Exclusion
if its name or folder structure contains letters, numbers, words or symbols listed by
Inclusions.

- Seperate Inclusions with a space.
- Maximum of 10 Inclusions accepted.
- Wildcards (*, ?) are NOT supported.

[03]======================================================================================

.: Explanation of Settings

Queue'eM supports 3 modes of operation:
Backup
Synchronize
Archive

- Backup will copy files from the Source Directory to the Target Directory.
- Synchronize will attempt to copy newer files from the Source Directory to the Target
  Directory and newer files from the Target Directory to the Source Directory.
- Archive operates the same as Backup, except it uses the presense of the Archive File
  Attribute Flag to decide if a file should be copied.
- An invalid mode entry will result in Queue'eM exiting with an error message.

Queue'eM supports 4 methods to determine if a file should be copied:
Blind Copy
Checksum Difference
Date/Time Difference
Newer Date/Time

Blind Copy will copy files unconditionally overwriting existing files.
- In Backup mode Queue'eM will simply copy all files from the Source Directory to the
  Target Directory regardless if the file already exists in the Target Directory.
- In Synchronize mode Queue'eM will first copy all files from the Source Directory to the
  Target Directory and then copy any files that exist in the Target Directory but not in
  the Source Directory to the Source Directory.
- In Archive mode Queue'eM will first check if a file has the Archive File Attribute Flag,
  copy the file from the Source Directory to the Target Directory if it does, then clear
  the Archive File Attribute Flag from the file in the Source Directory.
- This is the default method for Archive mode.

Checksum Difference will copy files if their checksum value differs.
- In Backup mode Queue'eM will only copy files from the Source Directory to the Target
  Directory if the file does not exist in the Target Directory or if the checksum value
  for the file does not match.
- In Synchronize mode Queue'eM will first check if a file in the Source Directory exists
  in the Target Directory and copy the file if it does not. If it already exists it will
  compare the checksum value for the files and do nothing if it matches. If the checksum
  value differs it will then perform a date/time stamp comparison and copy the newer file
  over the older file. If the checksum differs but the date/time stamp matches, the file
  will be copied from the Source Directory to the Target Directory.
- In Archive mode Queue'eM will only copy a file from the Source Directory to the Target
  Directory if the file in the Source Directory has the Archive File Attribute Flag and
  the file checksum values differ (or if the file does not exist in the Target Directory).
- Queue'eM uses the MD5 algorithm to calculate file checksum values.
- This is the default method for Backup mode and Synchronize mode.

Date/Time Difference will copy files if their date/time stamp value differs.
- In Backup mode Queue'eM will only copy files from the Source Directory to the Target
  Directory if the file does not exist in the Target Directory or if the date/time stamp
  for the file does not match.
- In Synchronize mode Queue'eM will only copy files from the Source Directory to the
  Target Directory if the file does not exist in the Target Directory or if the date/time
  stamp for the file does not match. Then it will copy any files that exist in the Target
  Directory but not in the Source Directory to the Source Directory.
- In Archive mode Queue'eM will only copy a file from the Source Directory to the Target
  Directory if the file in the Source Directory has the Archive File Attribute Flag and
  the file date/time stamps differ (or if the file doesn't exist in the Target Directory).
- This method is faster than Checksum Difference, but less reliable.

Newer Date/Time will copy files if their date/time stamp is more recent.
- In Backup mode Queue'eM will only copy files from the Source Directory to the Target
  Directory if the file does not exist in the Target Directory or if the date/time stamp
  for the file in the Source Directory is newer than the file in the Target Directory.
- In Synchronize mode Queue'eM will only copy files from the Source Directory to the
  Target Directory if the file does not exist in the Target Directory or if the date/time
  stamp for the file in the Source Directory is newer than the file in the Target
  Directory. Then it will copy any files that exist in the Target Directory but not in the
  Source Directory to the Source Directory.
- In Archive mode Queue'eM will only copy a file from the Source Directory to the Target
  Directory if the file in the Source Directory has the Archive File Attribute Flag and
  the date/time stamp for the file in the Source Directory is newer than the file in the
  Target Directory (or if the file doesn't exist in the Target Directory).
- This method is faster than Checksum Difference, but less reliable.

Queue'eM will use the folder listed by SourceDirectory as the folder to copy from.
Queue'eM will use the folder listed by TargetDirectory as the folder to copy into.

- Both SourceDirectory and TargetDirectory accept most NSIS folder constants and .. to go
  up a folder from the starting folder.

Accepted folder constants:
$PROGRAMFILES   (The program files directory, usually C:\Program Files)
$PROGRAMFILES32 (The same as $PROGRAMFILES)
$PROGRAMFILES64 (The program files directory on Windows x64, usually C:\Program Files)
$COMMONFILES    (The common files directory, usually C:\Program Files\Common Files)
$COMMONFILES32  (The same as $COMMONFILES)
$COMMONFILES64  (The common files directory on Windows x64, usually C:\Program Files\Common Files)
$DESKTOP        (The Windows desktop directory, usually C:\Windows\Desktop)
$EXEDIR         (The directory containing Queue'eM.exe, or where Queue'eM was run from)
$WINDIR         (The Windows directory, usually C:\Windows or C:\WinNT)
$SYSDIR         (The Windows system directory, usually C:\Windows\System or C:\WinNT\System32)
$TEMP           (The system temporary directory, usually C:\Windows\Temp)
$STARTMENU      (The start menu folder)
$SMPROGRAMS     (The start menu programs folder, use this whenever you want $STARTMENU\Programs)
$SMSTARTUP      (The start menu programs / startup folder)
$QUICKLAUNCH    (The quick launch folder for IE4 active desktop and above)
$DOCUMENTS      (The documents directory, typically C:\Documents and Settings\username\My Documents)
$SENDTO         (The directory that contains Send To menu shortcut items)
$RECENT         (The directory that contains shortcuts to the user's recently used documents)
$FAVORITES      (The directory that contains shortcuts to the user's favorite websites, documents, etc.)
$MUSIC          (The user's music files directory)
$PICTURES       (The user's picture files directory)
$VIDEOS         (The user's video files directory)
$NETHOOD        (The directory that contains link objects that may exist in the Network Neighborhood folder)
$FONTS          (The system's fonts directory)
$TEMPLATES      (The document templates directory)
$APPDATA        (The application data directory)
$LOCALAPPDATA   (The local (nonroaming) application data directory)
$PRINTHOOD      (The directory that contains link objects that may exist in the Printers folder)
$INTERNET_CACHE (Internet Explorer's temporary internet files directory)
$COOKIES        (Internet Explorer's cookies directory)
$HISTORY        (Internet Explorer's history directory)
$PROFILE        (The user's profile directory, typically C:\Documents and Settings\username)
$ADMINTOOLS     (A directory where administrative tools are kept)
$RESOURCES      (The resources directory that stores themes, usually C:\Windows\Resources)
$RESOURCES_LOCALIZED (Usually C:\Windows\Resources\1033)
$CDBURN_AREA    (A directory where files awaiting to be burned to CD are stored)
$EXEDRIVE       (The root directory from where Queue'eM was executed, C: if run from C drive)

Examples:
- Copy files from a folder next to the folder Queue'eM is in to a folder on the Desktop:
SourceDirectory=$EXEDIR\..\SaveData
;(SaveData subfolder in the same parent folder as the subfolder Queue'em is in)
TargetDirectory=$DESKTOP\SaveData
;(SaveData subfolder on the Desktop)
- Copy an entire Flash Drive to a Backup subfolder in My Documents:
SourceDirectory=$EXEDRIVE
;(the root folder (drive letter) for the Flash Drive Queue'eM was run from)
TargetDirectory=$DOCUMENTS\Backup
;(a Backup subfolder within My Documents)

Exclusions and Inclusions will either block or allow files to be copied based on letters,
numbers, words or symbols found within the file's name or folder structure (path).

- All Modes and Methods will obey Exclusions and Inclusions.
- All files are included by default.
- Use Exclusions=ALL to block all files (case sensitive).
- Use Inclusions to allow files blocked by Exclusions.
- Use \ to block or allow all subfolders.
- Exclusions and Inclusions are NOT case sensitive except when using ALL for Exclusions to
  block all files by default (all can be used to block filenames containing the word all).
- If no Exclusions are set, Inclusions are pointless.

- Seperate Exclusions with a space.
- Maximum of 10 Exclusions accepted.
- Seperate Inclusions with a space.
- Maximum of 10 Inclusions accepted.
- Wildcards (*, ?) are NOT supported.

Examples:
- Block all files in SourceDirectory but allow all files in subfolders of SourceDirectory:
Exclusions=ALL
Inclusions=\
- Block all files except common music files:
Exclusions=ALL
Inclusions=.mp3 .ogg .mid
- Block all EXE files except Queue'eM.exe:
Exclusions=.exe
Inclusions=Queue'eM.exe
- Block all subfolders but allow any text or document files:
Exclusions=\
Inclusions=.txt .doc
- Block all common video files:
Exclusions=.avi .mpg .mov
Inclusions=

[04]======================================================================================

.: Command Line Switches

Queue'eM supports 3 command line switches (which must be separated by spaces):
/S run silently without a visible window (case sensitive).
/A automatically close when finished (case sensitive).
/L log all file operations when finished (case sensitive).

- Logging (/L) does NOT work with Silent (/S).
- Logging (/L) does work with AutoClose (/A).
- Silent (/S) will AutoClose when finished (/A not needed).
- If Queue'eM.ini does NOT exist and Silent (/S) is used, Queue'eM will run using default
  settings (Backup, Checksum, $EXEDIR, $DOCUMENTS\Backup, No Ex/Inclusions).
- Logged file operations will be saved (appended) to Queue'eM.log.

[05]======================================================================================

.: Default INI File

If Queue'eM generates a default configuration file, Queue'eM.ini will contain the following:
[Info]
;This section is purely informative.
;Settings are read from the [Queue'eM] section below.

;Queue'eM supports 3 command line switches (must be separated by spaces):
;/S run silently without a visible window (case sensitive).
;/A automatically close when finished (case sensitive).
;/L log all file operations when finished (case sensitive).
;Logging does NOT work with Silent. Logging does work with AutoClose. Silent AutoCloses.

Mode=Backup, Synchronization or Archive. Back, Sync or Arch also work, as do B, S or A (not case sensitive).
;Backup copies files (and subfolders) from the SourceDirectory to the TargetDirectory.
;Synchronization copies files (and subfolders) from the SourceDir to the TargetDir, then vice versa.
;Archive copies files (and subfolders) that have the Archive Attribute Flag from the SourceDir to the TargetDir.

Method=Blind, Checksum, Difference or Newer. B, C, D or N also work (not case sensitive).
;Blind Copy will copy files unconditionally overwriting existing files.
;Checksum will copy files if their checksum value differs. For Sync a Newer check is also performed.
;Difference will copy files if their date/time stamp value differs.
;Newer will copy files if their date/time stamp is more recent.

SourceDirectory=Folder containing files (and subfolders) to be backed up.
TargetDirectory=Folder to backup files (and subfolders) into.
;Folders can use .. to go up a folder and accept most NSIS folder constants (i.e. $EXEDIR).

Exclusions=Basic rules for file (and folder) names not to be copied. Use ALL to Exclude all files.
Inclusions=Basic rules for file (and folder) names to be copied. Overrides Exclusions rules.
;Seperate with spaces. Maximum of 10 of each are supported. Wildcards (*, ?) are NOT supported.
;Leave both blank to process all files. All Modes and Methods obey Exclusions and Inclusions.

[Queue'eM]
Mode=Backup
Method=Checksum
SourceDirectory=$EXEDIR
TargetDirectory=$DOCUMENTS\Backup
Exclusions=
Inclusions=

[06]======================================================================================

.: Disclaimer

Your use of Queue'eM is at your own risk and no guarantee is given as to the operation or
performance of said program. You may reverse engineer and/or use the source code for
Queue'eM so long as credit is given to the original author (Quib Mask) for any derivative
works.
