|
|
UNC Name support
|
A local path can be a UNC name, which maybe reached
from outside the computer via share. Sometimes it is neccessary to use UNC names
to refer to local pathes.
ln resolves local UNC names to local path names and does its job on those resolved
path names. e.g.:
ln \\local_computer\ls\sourcefile.txt x:\dir_on_local_computer\destination.txt
In the above example there is a share called ls on your
local_computer which conains a file sourcefile.txt. ln resolves the
UNC name to a local path if possible, and creates a link between the resolved location
and destination.txt in x:\dir_on_local_computer.
|
|
|
Recursive support
|
ln.exe can recursivley hardlink all files found below a given directory location
to a newly created directory structure under a different location.
In other words this means, the given directory structure is rebuilt under a different
location, and all files from the given directory structure are hardlinked to the
newly generated structure. Something like a xcopy but the files are hardlinked and
not copied:
e.g.:
ln --recursive x:\dir\dir2 x:\dir\newdir
In the above example the directories below x:\dir\dir2 are rebuilt below
x:\dir\newdir, and all files from x:\dir\dir2 are hardlinked to their
corresponding locations under x:\dir\newdir.
A folder tree might also contain Junctions or Symbolic Links. The clone process
recreates inner junction/symbolic links at the destination
location very similar as SmartCopy does.
Outer Junctions/Symbolic links are recreated with respect to the specified
Outer Junction/Symbolic Link handling. e.g.
ln --unroll --recursive x:\dir\dir2 x:\dir\newdir
In the above example the directories below x:\dir\dir2 are rebuilt below
x:\dir\newdir, all files from x:\dir\dir2 are hardlinked to their
corresponding locations under x:\dir\newdir and all junctions/symbolic links
are unrolled.
With Windows Vista and Windows7/8 this cloning process is also available with Symbolic
Links instead of Hardlinks.
Output
See Output among Delorean Copy for a detailed description
of HardlinkClone's Output
Shell Integration
The recursive support or HardlinkClone functionality is
also available via
Link Shell Extension
|
|
|
Symbolic Links
|
When used under Vista or Windows7/8 ln.exe can create symbolic
links
ln --symbolic Sourcefile.txt SymbolicLinkToSourceFile.txt
In the above example a symbolic link SymbolicLinkToSourceFile.txt
is created which points to sourcefile.txt.
ln --symbolic SourceDirectory SymbolicLinkToSourceDirectory
In the above example a symbolic link SymbolicLinkToSourceDirectory
is created which points to SourceDirectory.
ln.exe can also only show the target of a symbolic link.
ln --symbolic SymbolicLinkToSourceFile.txt
Please make sure that symbolic links can just be successfuly created
from an administrative command prompt. ln.exe will fail on symbolic links from normal
command prompts!
|
|
Absolute
Symbolic Links
|
The target
of a symbolic link can either be
- a fully qualified path starting at the root of a drive, e.g e:\data\cpp\myfile.txt
- or can be be specified relativeley, e.g ..\..\data\cpp\myfile.txt
ln.exe by default tries to create relative target path names for symbolic
links as long as this is possible, e.g the file and its target are on the same logical
drive. Having relative symbolic link targets is much smarter especially when the
target of links is in the same directory. If a symbolic link and its target are
on different drives, ln.exe uses absolute pathnames.
If the creation of absolute target pathnames should be forced use the --absolute option.
ln --absolute --symbolic sourcefile.txt destination.txt
In the above example sourcefile.txt gets symbolycally linked to
destination.txt, but the target path in the symbolic link is absolute.
ln --absolute --symbolic SourceDirectory DestinationDirectory
In the above example a symbolic link directory SourceDirectory
gets symbolycally linked to DestinationDirectory, but the target path in
the symbolic link is absolute.
|
|
|
Normal linking
|
Just for completeness: ln.exe can do the normal ln stuff
too.
ln sourcefile.txt destination.txt
In the above example sourcefile.txt
gets linked to destination.txt
|
|
|
Smart Copy
|
Smart Copy basically creates a copy of the directory
structure from the source location to the destination, but it preserves the inner
hardlink structure and inner junction/symbolic link relations of the source, and
recreates this inner hardlink structure and inner junction/symbolic link relation
at the destination location:
With hardlinks it behaves as follows:
By closely looking at the above picture one can
find three different types of files:
|
Normal Files
|
The file B is a normal file. It gets copied as any other
copy tool would do.
|
|
Saturated Hardlinks
|
The files E and F are hardlinked together. In LSE naming
universe they are called Saturated Hardlinks, because the reference count,
which is here 2, matches the number of occurrences below 'Folder 1', which is here
2.
In General: A hardlink is called Saturated with respect to a folder F,
if the number of occurrences below the folder F matches the reference count.
Saturated Hardlinks can be copied completely via Smart Copy.
|
|
Unsaturated Hardlinks
|
The File A, C, D are hardlinked together. In LSE naming
universe they are called Unsaturated Hardlinks, because the reference count,
which is here 3, does not match the number of occurrences below 'Folder 1', which
is here 2. Only C and D are below Folder 1.
In General: A hardlink is called Unsaturated with respect to a folder F,
if the number of occurrences below the folder F is smaller than the reference
count.
Unsaturated Hardlinks can only be partially copied by Smart Copy. In the above example
C and D are hardlinked together in the destination location, but the hardlink to
A is broken. This means that the reference count of C and D is 2 with the destination
location.
|
With junctions or symbolic link directories
the default behaviour during smartcopy is as follows:
By closely looking at the above picture one can find three different types of folders/junctions:
|
Normal Folders
|
The folder 'Folder 3' is a normal folder. It gets copied
with its content as any other copy tool would do.
|
Inner Junctions
Symlinks
|
The folder 'Inner Junction/Symlink' is targeted at 'Inner
Junction/Symlink Target'. In LSE naming universe this kind of folder is called
Inner Junction/Symlink, because its target points to a folder, which is below
the common anchor 'Folder 1'.
Inner Junctions/Symlinkare restored properly via Smart Copy in the destination
location.
|
Outer Junctions
Symlinks
|
The folder 'Outer Junction/Symlink' is targeted at the
folder 'Outer Junction/Symlink Target'. In LSE naming universe this kind of folder
is called Outer Junction/Symlink, because its target points to a folder,
which is in paralell and thus outside the anchor 'Folder 1'.
Outer Junctions/Symlink can be handled in three different ways. Please see
the section on Outer Junction/Symlink Handling.
|
Windows7/8 and Windows Vista support Symbolic Links, which behave as follows during
Smart Copy:
By closely looking at the above picture one can find three different types of files/symbolic
links:
|
Normal Files
|
The file A is a normal file. It gets copied as any other
copy tool would do.
|
Inner Symbolic
Links
|
The symbolic link 'Inner Symlink' is targeted at 'Inner
Symlink Target'. In LSE naming universe this kind of symbolic link is called Inner
Symlink, because its target points to a file, which is below the common anchor
'Folder 1'.
Inner Symlink are restored properly via Smart Copy at the destination location.
|
Outer Symbolic
Links
|
The symlink 'Outer Symlink' is targeted at the folder
'Outer Symlink Target'. In LSE naming universe this kind of symbolic link is called
Outer Symlink, because its target points to a file, which is in paralell
and thus outside the anchor 'Folder 1'.
Outer Symlink are handled by Smart Copy depending on the
Outer Junction/Symbolic Link handling.
|
e.g.:
ln --copy x:\dir\dir2 y:\dir\newdir
In the above example the directories and files below
x:\dir\dir2 are copied to y:\dir\newdir, and all hardlinks/junctions/symbolic
links within x:\dir\dir2 are copied/tied to their new locations under y:\dir\newdir.
The --copy operation only copies if the files in the destination are either not
there, or if the files in the source are newer. Otherwise the item is skipped. See
also the note on quotes.
If you use ln.exe as a backup tool with the --copy option, please make sure you
test that everything is copied. I tested ln --copy many times, and had no problems,
but when it comes to backing up data, one has to be careful.
Smart Copy is a must if e.g. the whole content of a hard disk, which has lots of
hardlinks/junctions/symbolic links, should be copied to another hard disk. During
the Smart Copy operation empty folders get copied too and the date/time stamps of
folders/junctions/symbolic links are also restored at the corresponding destination
locations.
Because Smart Copy creates inner hardlinks/junctions/symbolic links, this feature
is only available on NTFS volumes.
Smart Copy also processes all available alternative NTFS streams of a file.
Output
See Output among Delorean Copy for a detailed descritption
of Smart Copies output.
Shell Integration
The Copy or Smart Copy functionality is also available via
Link Shell Extension
|
Crop/Unroll/Splice
Outer Junctions/
Symbolic Links
|
During SmartCopy,
Smart Mirror, Delorean Copy and
Clone so called Outer Junctions/Symlink directories
may need processing. There are 3 different ways to deal with those Outer Junctions/Symlink
directories:
|
Crop
|
Crop breaks links to Outer Junctions/Symlink directories
in the destination.
Crop also applies to Outer Symlink Files.
In the above example Folder1 is copied to Destination/Folder1, but
Outer Junction/Symlink is not available in the destination, because Folder1/Outer
Junction/Symlink pointed to Folder0/Outer Junction/Symlink Target,
which is not below Folder1.
The objective behind cropping Outer Junctions/Symlink Directories is to get a pure
copy during Smart Copy, Smart Mirror, Delorean Copy and Clone without connections
to the source.
Enabling Crop for Outer Junction/Symbolic Links
Crop can be selected via the configuration tool.
|
|
Unroll
|
Unroll follows Outer Junctions/Symlink Directories
and rebuilds the content of Outer Junctions/Symlink Directories inside the hierarchy
at the destination location.
Unroll also applies to Outer Symlink Files, which means, that unroll causes
the target of Outer Symlink Files to be copied to the destination location.
In the above example Folder1 is copied to Destination/Folder1, and
Outer Junction/Symlink and all the files/directories below Outer Junction/Symlink
Target are copied to the folder Outer Junction/Symlink in the destination.
The objective behind unrolling Outer Junctions/Symlink Directories is to get everything
with which the source is connected and rebuild it as seperate copy in the destination.
It resembles the 'hair of the elephant' pattern: Pull on a hair of an elephant,
and get the whole elephant.
The command line invocation below unrolls all junctions/symbolic
link directories below "c:\Folder 1"
ln --unroll --copy "c:\Folder 1" "c:\Destination\Folder
1"
In certain situations only certain junctions/symbolic
link directories should be unrolled during SmartCopy, DeloreanCopy, SmartMirror
or HardlinkClone. To accomplish this ln.exe can be run with wildcard expressions
to specify certain directories for unrolling.
ln --unroll "MyJunc*" --copy "c:\Folder 1" "c:\Destination\Folder
1"
To specify junctions/symbolic link directories for unrolling
more fine grained regular expressions can be given:
ln --unrollregexp "[a-z]*" --copy "c:\Folder 1"
"c:\Destination\Folder 1"
The regular expressions used must conform to
POSIX 1003.2 extended RE (ERE) syntax. The regular expression specified under
--unrollregexp is applied to the whole source path:
ln --unrollregexp "Folder 1\\MyJunc*" --copy "c:\Folder
1" "c:\Destination\Folder 1"
In this example only Outer Junctions/Symbolic Link Directories, matching "Folder
1\\MyJunc*" are unrolled. Please make sure that the back slash \ is escaped by a
double \\ as shown in the above example.
Advanced thoughts on Unrolling
The picture above was just the simplest case, because Unroll does much more
when it encounters complex situations. Think of a outer junctions/symbolic links,
which itself contains junctions/symbolic links, which are inner with respect to
the first outer junction symbolic link:
In the above example Folder1 is copied to Destination/Folder1, and
Outer Junction/Symlink and is unrolled as expected, but since Junction/Symlink
is a inner junction with respect to Outer Junction/Symlink Target, the junction/symlink
relation is restored in the destination.
This kind of nesting can be much more complex:
In the above example Folder1 is copied to Destination/Folder1, and
Outer Junction/Symlink and is unrolled as expected, but then it starts to
get fascinating, because we have two levels of outer junctions/symlinks which all
have respective inner junctions/symlinks, and which are restored properly. Once
you digged yourself through the above picture, you got it. It is not simple I know,
but it is neccessary to properly unroll.
And complexity increases if symbolic link files are within unrolled outer
junctions/symbolic links:
In the above example Folder1 is copied to Destination/Folder1, and
Outer Junction/Symlink and is unrolled as expected, but it contains Inner
Outer Symlink which points to Inner Outer Symlink Target and this is
a inner junction/symbolic link with respect to Outer Junction/Symlink Target
But worth mentioning is the Symbolic Link Outer Symlink, which would be a
definitive outer symbolic link, but since its targets parent-directory Outer Junction/Symlink
Target is unrolled, Outer Symlink becomes an inner symbolic link with
respect to Folder1.
File1 Symlink is also a outer symbolic link, but its target parent-directory
Folder2 is not that lucky to get unrolled, so in the destination File1 Symlink
is not a symbolic link any more, but a copy of the symbolic links' target.
Nested Reparse Points are also an interesting use case, which the algorithm has to tackle with:
In the above example Folder1 is copied to Destination, and
Junction/Symlink F0 and is unrolled as expected, but it contains inner
nested reparse points. Nested means Reparse point pointing to Reparse Points
The Unroll functionality also opens up the possibility to have circular Junction/Symbolic
Link relations among a set of copied items:
In the above example Folder1 is copied via the --unroll option to Destination/Folder1.
Smart Copy/Smart Mirror and Delorean Copy operations can deal with the above shown
circularities and break circularities by not following the affected Junction/Symbolic
Link.
Junctions/Symbolic Links can also point to FAT drives or other NTFS drives requiring
as a prerequisite unique Disk-IDs on all disks, which are chained together via Junctions/Symbolic
links:
Hardlink siblings are found by matching the per NTFS volume uniqe file-id, but if
more volumes are chained together it might happen that the same file-ids can be
found on two different NTFS volumes. To address this all operations use the disk-id
and the file-id to match hardlink siblings.
Furthermore it is not allowed to have the disk-id 0xffff-ffff, because the algorithms
use this as internal indicator of a FAT drive.
The Unroll option also allows to point multpile junctions to the same target location,
which causes the algorithms to traverse the same items many times:
At the first glance multiple traversation of items looks simple, but for files this
means that multiple traversed files are the same in the destination and are hardlinked
together. So don't be confused when you see hardlinks, which have never ever been
there before.
|
|
Splice
|
Splice reconnects Outer Junctions/Symlink directories
in the destination to their original targets.
In the above example Folder1 is copied to Destination/Folder1, and
Outer Junction/Symlink is available in the destination as junction, which
points to the original location Outer Junction/Symlink Target.
The objective behind splicing Outer Junctions/Symlink Directories to its original
location is to get a copy during smartcopy, but to reuse Outer Junctions/Symlink
Directories source locations.
The command line invocation below splices all junctions/symbolic
link directories below "c:\Folder 1"
ln --splice --copy "c:\Folder 1" "c:\Destination\Folder
1"
In certain situations only certain junctions/symbolic
link directories should be spliced during SmartCopy, DeloreanCopy, SmartMirror or
HardlinkClone. To accomplish this ln.exe can be run with wildcard expressions to
specify certain directories for splicing.
ln --splice "MyJunc*" --copy "c:\Folder 1" "c:\Destination\Folder
1"
To specify junctions/symbolic link directories for unrolling
more fine grained regular expressions can be given:
ln --spliceregexp "[a-z]*" --copy "c:\Folder 1"
"c:\Destination\Folder 1"
The regular expressions used must conform to
POSIX 1003.2 extended RE (ERE) syntax.
|
|
|
Multiple Source
|
Multpiple source locations can be specified for SmartCopy, Clone and
Delorean Copy. If there are junctions/symlinks between these source locations, they are handled as
inner junctions/symlinks, because all source locations are dealt like a common root.
In the above example Location 1 and Location 2 are copied to Destination.
Location2/Junction_Symlink is treated as inner junctions to Location1/Folder 10 in the source,
and that's why Destination/Junction_Symlink points to Destination/Folder 10 in the Destination.
The objective behind this is to treat all junctions/symlinks as inner junctions/symlinks as long as
they are in the set of source folders.
The command line invocation below copies from "c:\Location 1" and "c:\Location 2"
to c:\Destination :
ln --source "c:\Location2" --copy "c:\Location1" "c:\Destination"
There can be more than one additional --source command-line switches:
ln --source "c:\Location 2" --source "d:\Location 5" --copy "c:\Location 1" c:\Destination
Specifying additional source pathes can be combined with --splice or --unroll:
ln --unroll --source "c:\Location 2" --copy "c:\Location 1" c:\Destination
|
--mirror Smart Mirror
|
Smart Mirror is very similar to Smart Copy
and not only copies but synchronises the folder Source to Destination:
- Smart Copy only different items from Source to Destination.
- Delete items not anymore in Source from Destination.
Smart Mirror takes care of Hardlink Relations, restores Inner Junctions or Inner Symbolic links or when
issued unrolls or splices Outer Junctions or Outer Symbolic Links.
Different Items means: Either the file size changed, or the 'Last Write Date' changed.
e.g.:
ln --mirror x:\source x:\destination
In the above example the directory x:\source is mirrored to x:\destination,
and all symbolic links and junctions within x:\destination are updated with
respect to their new locations under x:\destination.
The filters of --includeXXX or --excludeXXX are applied in the soure and the destination location
See also the note on quotes.
Shell Integration
Smart Mirror functionality is also available via
Link Shell Extension
|
--mirror --symbolic Clone Mirror
|
The Clone Mirror function is a combination of Smart Mirror
and SmartClone. Basically it creates a Symbolic Link Clone from Source to Destination directory,
but also synchronises the folder Source to Destination:
- Create a symbolic link Clone from Source to Destination.
- Delete symbolic links in Destination which are not anymore in Source
Clone Mirror takes care of Inner Junctions, Inner Symbolic links or when
issued unrolls or splices Outer Junctions or Outer Symbolic Links.
Different Items means: The 'Last Write Date' has changed.
e.g.:
ln --symbolic --mirror x:\source x:\destination
In the above example the directory x:\source is cloned to x:\destination,
and all symbolic links and junctions within x:\destination are updated with
respect to their new locations under x:\destination. Furthermore symbolic links, which are in the
Destination, but are not anymore in Source, are deleted from the Destination
See also the note on quotes.
Shell Integration
Smart Mirror functionality is also available via
Link Shell Extension
|
|
Smart Move
|
Smart Move enables folders with junctions and symbolic
links beneath to be renamed, and the junctions and symbolic links' targets are updated
below that folder. Without Smart Move renaming of such folders would end in dangling
junctions and symbolic links.
With junctions or symbolic link directories it behaves as follows:
By closely looking at the above picture one can find three different types of folders/junctions:
|
Normal Folders
|
The folder 'Folder 3' is a normal folder. It gets moved
with its content straight forward.
|
Inner Junctions
Symlinks
|
The folder 'Inner Junction/Symlink' is targeted at 'Inner
Junction/Symlink Target'. In LSE naming universe this kind of folder is called
Inner Junction/Symlink, because its target points to a folder, which is below
the common anchor 'Folder 1'.
Inner Junctions/Symlink are updated properly via Smart Move in the destination
location.
|
Outer Junctions
Symlinks
|
The folder 'Outer Junction/Symlink' is targeted at the
folder 'Outer Junction/Symlink Target'. In LSE naming universe this kind of folder
is called Outer Junction/Symlink, because its target points to a folder,
which is in paralell and thus outside the anchor 'Folder 1'.
Outer Junctions/Symlinks are not touched by Smart Move and thus stay connected
to their respective target. Please note that this is different to Smart Copy, which
has 3 different ways to deal with Outer Junctions/Symlinks.
|
e.g.:
ln --move x:\dir\dir2 x:\dir\newdir
In the above example the directory x:\dir\dir2 is moved to x:\dir\newdir,
and all symbolic links and junctions within x:\dir\dir2 are updated with
respect to their new locations under x:\dir\newdir.
See also the note on quotes.
Shell Integration
Smart Move functionality is also available via
Link Shell Extension
|
--delorean DeLorean Copy
|
DeLorean Copy is a way of creating incremental backups
by using a combination of hardlink clone and Smart Copy.
The following picture gives an overview what DeLorean Copy is about
In general a DeLorean Copy has 3 principals: Source(t), InitialBackup and Backup(n).
|
Phase 1: Intial SmartCopy
|
The folder Source(t) is initially copied to
InitialBackup. This is shown by the blue arrow.
|
Changes
happen
|
During this phase the files under source change, and
Source(t) becomes Source(t+1).
|
Phase 2: Hardlink Clone
|
The folder InitialBackup is Hardlink Cloned to
Backup1, which ties InitialBackup and Backup1. This is shown
by the red arrow.
|
Phase 3: Mirror
|
Mirror the folder Source to Backup1. This
is shown by the green arrow:
- Keep unchanged files as hardllinks to InitialBackup.
- Delete files not anymore in Source(t+1) from Backup1.
- Copy different files from Source(t+1) to Backup1.
|
With completion of this first round Backup1 contains the first lean and mean
copy of Source only consisting of either hardlinks to InitialBackup,
or of copied files if there was the need to copy them over from Source(t+1)
because they were newer under Source(t+1).
The point is that all files in Backup1 are transparently accessible, but
really little space is used, because not all files in the Source(t+1) changed,
so that there was only the need to effectively copy over a few files from Source(t+1)
to Backup1.
Different items means: Either the file size has changed, or the 'Last Write Date' has changed.
This can be repeated on and on. The second round would be using Source,
Backup1 and Backup2 for DeLorean Copy:
Changes
happen
|
During this phase the files under source change, and
Source(t+1) becomes Source(t+2).
|
Phase 2: Hardlink Clone
|
The folder Backup1 is Hardlink Cloned to Backup2,
which ties Backup1 and Backup2. This is shown by the red arrow.
|
Phase 3: Mirror
|
Mirror the folder Source(t+2) to Backup2.
This is shown by the green arrow:
- Keep unchanged files as hardllinks to Backup1.
- Delete files not anymore in Source(t+2) from Backup2.
- Copy different files from Source(t+2) to Backup2.
|
A real word example looks like this:
ln --copy x:\dir\Source x:\dir\InitialBackup
This creates the initial Backup as shown above in Phase 1
ln --delorean x:\dir\Source x:\dir\InitialBackup
x:\dir\Backup1
This command does the first round of DeLorean copy as shown above
in Phase 2 and Phase 3 creating a backup.
ln --delorean x:\dir\Source x:\dir\Backup1
x:\dir\Backup2
This command creates another set of incremental DeLorean copy as shown
above in Phase 2 and Phase 3 creating another backup.
See also the note on quotes.
Output
The output generated by DeLorean Copy/Smart Copy/Smart Clone/Smart Mirror looks like e.g.:
-f c:\backup\test\deleteme.dat
=d c:\backup\test\directorygone
+f c:\data\test\1.dat
+f c:\data\foo\3.dat
*h c:\data\foo\Hardlink of 3.dat
*h c:\data\foo\Another Hardlink of 3.dat
.h c:\data\already\x.dat
*h c:\data\already\Hardlink of x.dat
~f c:\data\failed\DidntMatch--splice.txt
!?f (0x00000002) c:\data\failed\AccessDenied.txt
Basically Delorean Copy protocols each action it did, and prefixes two characters
to each item it processed for each line of the output. The first column of the output
contains the Operation, which was performed, and the second column specfies the
Type of item, which was processed.
|
Operation
|
Description
|
|
=
|
Item is already present in the target. Used during Smart Mirror
|
|
+
|
Copy/Create an item. Used during Smart Copy
|
|
*
|
Hardlink a file
|
|
.
|
Item is already present in the target and is used as the
source of a newly created hardlink.
|
|
-
|
Remove an item from the target that is not present in the source. Used during Smart Mirror
|
|
?
|
Enumerate an item.
|
|
~
|
Item has been excluded by command line arguments.
|
|
#
|
Item has been cropped due to being an outer junction/symlink.
|
|
&
|
Junction or Symbolic Link has been re-created but turned out to be dangling in the destination.
|
|
\
|
Opening a file.
|
|
/
|
Map file into adress space.
|
|
!
|
An error happened.
|
|
Item
|
Description
|
|
f
|
A File is processed.
|
|
h
|
A Hardlink is processed.
|
|
s
|
A Symbolic link file or Symbolic Link Directory.
|
|
j
|
A Junction is processed.
|
|
d
|
A Directory is processed.
|
|
Sample
|
Description
|
|
+f c:\data\myfile.txt
|
A normal file is copied.
|
|
*h c:\data\hardlnk.txt
|
c:\data\hardlnk.txt is hardlinked to c:\data\myfile.txt.
|
|
+s d:\dest\symlink.txt
|
A Symbolic link has been created.
|
|
+j d:\dest\junc01
|
A Junction has been created.
|
|
+d d:\dest\mydir
|
A Directory has been created.
|
|
-f d:\dest\delfile
|
d:\dest\delfile has been removed during e.g. Smart Mirror.
|
|
-j d:\dest\junc02
|
The Junction d:\dest\junc02 has been removed.
|
|
=d d:\dest\mydir
|
The directory d:\dest\mydir is the same as in the source.
|
|
=s d:\dest\symlink
|
The symlink d:\dest\symlink is the same as in the source.
|
|
.h d:\dest\file.txt
|
means that the name of this file is only printed,
because some hardlinks have been newly tied to it. The file itself is already
in the backup available, but the files following it are prefixed with * and are the
newly tied hardlinks.
|
|
*h d:\dest\new_hlink
|
If the line above is prefixed with . it means that
d:\dest\new_hlink is tied to e.g. the already existing file d:\dest\file.txt.
|
|
~d d:\source\mydir
|
The directory d:\source\mydir has been excluded
intentionally by either e.g. --exclude.
|
|
~f d:\source\aFile
|
The file d:\source\aFile has been excluded intentionally by
e.g. --exclude. Items are also listes with ~ if the --unroll option is not used and outer
Junctions or Symbolic Links are cropped.
|
|
#d d:\source\outerreparse
|
The junction/symlink d:\source\outerreparse has been excluded
because it was an outer junction/symlink.
|
|
&d d:\dir\danglingreparse
|
The Junction or Symbolic Link d:\dir\danglingreparse has been restored,
but it turned out that it is dangling in the destination.
.
|
|
!-d (0x00000002) d:\source\aFile
|
The ! operator indicates that there was an error.
It is followed by the operation, the item which were processed and an Win32 error code.
|
|
!?d (0x00000005) d:\src\deny
|
The ? operator means the current operation was unable to enumerate all available files.
It is always prefixed with ! to signal, that during enumeration of items something went wrong.
|
|
!?j (0x00000423) d:\src\deny
|
Circularities are detected during Smart Copy/Smart Mirror/Delorean Copy and are flagged as
error with the code 0x0423, which means ERROR_CIRCULAR_DEPENDENCY.
|
|
!?s (0x00000780) d:\src\deny
|
The error ERROR_CANT_ACCESS_FILE aka 0x0780 is thrown only under Windows
XP if a symbolic link is among the files to operate on, because Windows XP can not process Symbolic
Links unless the symbolic link driver for Windows XP is installed.
|
|
!&j (0x000000a1) d:\src\dangling_junction
|
The error ERROR_BAD_PATHNAME aka 0x00a1 is thrown only under Windows
XP if a dangling junction can not be restored.
|
Statistics
After DeLorean Copy is finished it shows a statistics e.g like this one:
|
|
Total |
Copied |
Linked |
Skipped |
Removed |
Excluded |
Failed |
|
Folder: |
10 |
1 |
- |
6 |
1 |
3 |
0 |
|
File: |
1050 |
1026 |
4 |
0 |
3 |
0 |
20 |
|
Junction: |
7 |
- |
2 |
0 |
2 |
3 |
0 |
|
Symlink: |
8 |
- |
2 |
5 |
1 |
0 |
1 |
|
Byte: |
458200 |
272600 |
185600 |
0 |
1392 |
0 |
0 |
|
|
|
|
Overall |
Clone |
Mirror |
|
Times: |
00:00:02.621 |
00:00:02.559 |
00:00:00.062 |
The statistics of DeLorean Copy only counts the operations, which are performed during the
Mirror phase between Source and Backup(n+1). The operations which are performed during
cloning between Backup(n) and Backup(n+1) are not counted in the final DeLorean Copy statistics.
Total: The total number of items as they were found under the Source. Total
is the sum of all other columns but the Removed column.
Copied:
- Items prefixed with + in the verbose output and which were were copied from Source to Backup
- Items prefixed with & in the verbose output and which have turned out to be dangling Junctions
or Symbolic Links in the Backup
Linked:
- Items prefixed with * in the verbose output which were either hardlinks
- Items prefixed with + in the verbose output which were symbolic links
Skipped:
- Items prefixed with = in the verbose output, which were skipped during copy, because they
were already there
Removed:
- Items prefixed with - in the verbose output, and which were removed from Backup because
they are not the anymore under Source.
Excluded:
- Items prefixed with ~ in the verbose output and which were excluded from Backup, because
they were excluded from the Source via --exclude.
- Items prefixed with # in the verbose output, because --splice/--unroll
was specified with a regular expression, but the regexp didn't match.
- Items prefixed with # in the verbose output, because no --unroll or --splice was given at all, thus it was
cropping.
Failed:
- The number of items which failed during creation.
- The number of items which failed during cleaning while SmartMiror and while Deloran Copy.
Overall: Time used up for the whole DeLorean Copy including the Clone from
Backup(n) to Backup(n+1) and the Mirror from Source to Backup(n+1)
Clone: Time used up for the Clone from Backup(n) to Backup(n+1)
Mirror: Time used up for the the Mirror from Source to Backup(n+1)
Limitations
It is little known, but NTFS has a limit to create a maximum of 1023 hardlinks to
one file. For DeLorean Copy this means that it will display an error message if
this limit is exceeded, because exceeding this limit means loss of data among the
most recent backup sets:
Delorean Copy FAILED! The NTFS link
limit of 1023 has been exceeded for:
The reason for exceeding this limit could either be, that there have been more than
1023 backup sets but no hardlinks within the Source, or there are hardlinks
within the Source and less than 1023 backup sets.
The filters of --includeXXX or --excludeXXX are applied in the soure and the destination location
Shell Integration
DeLorean Copy functionality is also available via
Link Shell Extension
|
|
--exclude Exclude files via wildcards
|
In certain situations not all files below a path should
be used in Smart Copy, Smart Mirror, Delorean Copy or Clone. To accomplish this ln.exe
can be run with wildcards specified to exclude certain files.
ln --exclude *.ocx --exclude *.dll --delorean c:\source d:\b\dest d:\b\bk1
Basically any arbitrary wildcard expressions can be used, because
the wildcard expressions are translated into a regular expression. This means that e.g *file*.ext*.*
is also a valid wildcard expression for --exclude.
The wildcard expression specified under --exclude is applied to the filename only.
|
|
--excludedir Exclude directories via wildcards
|
In certain situations not all directories should
be used in Smart Copy, Smart Mirror, Delorean Copy or Clone. To accomplish this ln.exe
can be run with wildcards to exclude certain directories.
ln --excludedir *test* --delorean c:\source d:\b\dest d:\b\bk1
Basically any arbitrary wildcard expressions can be used, because
the wildcard expressions are translated into a regular expression. This means that e.g *file*.ext*.*
is also a valid wildcard expression for --excludedir.
The wildcard expression specified under --excludedir is applied to the whole path, which means that e.g
ln --excludedir "fotos\\temp" --copy c:\source d:\b\dest
will exclude all directories containing 'fotos\temp' and their
subdirectories. The above expample will e.g. exclude 'fotos\tempur\myfotos', 'fotos\temp\myfotos'
or 'fotos\tempomat\myfotos'. Please make sure that '\' has to be escaped via '\\'
|
|
--excluderegexp Exclude files via regular expressions
|
In certain situations not all files below a path should
be used in Smart Copy, , Smart Mirror, Delorean Copy or Clone. To accomplish this ln.exe
can be run with regular expressions specified to exclude certain files.
ln --excluderegexp "[a-z]*" --copy c:\source d:\b\dest
The regular expressions used must conform to
POSIX 1003.2 extended RE (ERE) syntax.
The regular expression specified under --excluderegexp is applied to the filename only.
|
|
--excluderegexpdir Exclude directories via regular expressions
|
In certain situations not all directories should
be used with Smart Copy, Smart Mirror, Delorean Copy or Clone. To accomplish this ln.exe
can be run with regular expressions to exclude certain directories.
ln --excluderegexpdir "[a-z]*" --delorean c:\source d:\b\dest d:\b\bk1
The regular expressions used must conform to
POSIX 1003.2 extended RE (ERE) syntax.
The regular expression specified under --excluderegexpdir is applied to the whole path.
|
|
--enum Enum hardlinks
|
Sometimes it is convenient to find out which files
are linked together, because hardlinked files might be spread around a NTFS volume.
This is somehow the inverse hardlink functionality and it can be invoked as follows
ln --enum path
In the above example files below path are searched, and
the files which are hardlinked are printed out.
The --enum option first prints so called saturated and afterwards unsaturated
hardlinks. For saturated hardlinks the number of files found below path
matches the hardlink reference count of these files, but unsaturated hardlinks
have a reference count greater than the number found below path.
|
|
--include Include files via wildcards
|
To selectivley run Smart Copy, Smart Mirror, Delorean Copy or Clone on a certain
set of files, the --include option can be used with wildcards.
ln --include *.ocx --include *.dll --delorean c:\source d:\b\dest d:\b\bk1
Basically any arbitrary wildcard expressions can be used, because
the wildcard expressions are translated into a regular expression. This means that e.g *file*.ext*.*
is also a valid wildcard expression for --include.
The wildcard expression specified under --include is applied to the filename only.
|
|
--includedir Include directories via wildcards
|
To selectivley run Smart Copy, Smart Mirror, Delorean Copy or Clone on a certain
set of directories, the --includedir option can be used with wildcards.
ln --includedir *test --delorean c:\source d:\b\dest d:\b\bk1
Basically any arbitrary wildcard expressions can be used, because
the wildcard expressions are translated into a regular expression. This means that e.g *src\\sub?older*
is also a valid wildcard expression for --includedir.
The wildcard expression specified under --includedir is applied to the whole path, which means that e.g
ln --includedir "*fotos\\temp*" --copy c:\source d:\b\dest
will include all directories containing 'fotos\temp' and their
subdirectories. The above expample will e.g. include 'fotos\tempur\myfotos', 'fotos\temp\myfotos'
or 'fotos\tempomat\myfotos'. Please make sure that '\' has to be escaped via '\\'
|
|
--includeregexp Include files via regular expressions
|
To selectivley run Smart Copy, Smart Mirror, Delorean Copy or Clone on a certain
set of files, the --includeregexp option can be used with regular expressions specified to include certain files.
ln --includeregexp "[a-z]*" --copy c:\source d:\b\dest
The regular expressions used must conform to
POSIX 1003.2 extended RE (ERE) syntax.
The regular expression specified under --includeregexp is applied to the filename only.
|
|
--includeregexpdir Include directories via regular expressions
|
To selectivley run Smart Copy, Smart Mirror, Delorean Copy or Clone on a certain
set of directories, the --includedir option can be used with regular expressions to include certain directories.
ln --includeregexpdir "[a-z]*" --delorean c:\source d:\b\dest d:\b\bk1
The regular expressions used must conform to
POSIX 1003.2 extended RE (ERE) syntax.
The regular expression specified under --includeregexpdir is applied to the whole path.
|
|
--junction Create Junctions
|
ln.exe can also create junctions, and print the target
of junctions
ln --junction JunctionName TargetDirectory
In the above example a junctionJunctionName is created, which
point to TargetDirectory
ln --junction JunctionName
In the above example the junctionJunctionName is searched for
its Target and the target is printed out.
rd JunctionName
In the above example the junctionJunctionName removed. This is
accomplished with an simple built in command prompt command.
|
|
--list List Hardlink siblings
|
With Vista finding out the siblings of a hardlink
is very simple and needs no timeconsuming operations
ln --list filename
In the above example the hardlink siblings for filename are printed
out.
With XP, W2K or W2K3 finding the hardlink siblings now also works, but it takes
more time, because in the worst case the whole logical volume must be searched.
|
|
--output Redirect Output
|
The ouptut of ln.exe can be redirected to files via commandline option
ln --output filename --copy src dest
In the above example all output is redirected to filename
.
|
|
--quiet specify log level
|
The amount of output during various operations can be controlled
via the --quiet switch:
ln --quiet ...
The --quiet option without arguments totally disables any output during ln.exe' operations.
To specify the amount of output more granular an optional argument can be passed
to the --quiet switch:
|
0
|
Completely suppress output. This is the same as no argument would have been passed to --quiet.
|
|
1
|
Only show severe errors.
|
|
2
|
Show the changes, e.g if a file is copied additionally during delorean copy. Furthermore
show severe errors.
|
|
3
|
Show all output available. This is same as --quiet has been ommitted.
|
ln --quiet 2 ...
In the above example only changes are shown.
|
|
--skipfiles
|
This option is a modifier to Smart Copy, Smart Mirror, Delorean Copy, or Clone, so that only directories
symlinks and junctions are processed. The files are ommitted with this modifier used.
ln --skipfiles --copy source destination
|
|
--smartrename Smart Rename
|
Smart Rename is very similar to Smart Move, but
only renames junctions/symbolic links references below a given folder.
ln --smartrename x:\dir\dir2 x:\dir\newdir
In the above example the symbolic links/junction references below x:\dir\dir2 are renamed to x:\dir\newdir.
This leaves x:\dir\dir2 with dangling symbolic links/junction, but this feature is useful if someone wants to migrate
a whole disk to another physical media.
ln --copy x:\ y:\
unmount disk from x:\
mount disk under y:\
ln --smartrename y:\ x:\
unmount disk from y:\
mount disk under x:\
See also the note on quotes.
|
--timetolerance
|
During --mirror and --delorean it is sometimes useful to not have an exact timestamp comparison bewteen
source and dest, but kind of a fuzzy comparison, because the systemtime of NAS drives is not exactly synced
with the host.
To overcome this ln.exe has a --timetolerance switch to specify a value in milliseconds
ln --timetolerance 2000 --mirror source destination
|
|
--traditional Traditional mode
|
Some NAS boxes only support a very outdated version of the SMB protocol. SMB is
used when network drives are connected. This old version of SMB in certain situations does not support the
fast enumeration methods of ln.exe, which causes ln.exe to simply do nothing in SmartXXX functions.
To overcome this ln.exe has a --traditional switch, which forces ln.exe to enumerate files the old, but a
little slower way.
ln --traditional --copy source destination ...
|
|
--trueSize Size calculation
|
Prints the true space used taking into account hardlinks. This means that a file with a size of e.g 12345kb and
a reference count 5, will be listed with 61725kb by explorer, but indeed it only uses 12345kb, because it has a
refcount of 5.
ln --truesize path
returns the following output
|
|
Total |
Bytes |
|
File: |
14.012 |
6.871.558.902 |
|
Hardlink: |
5 |
133.991 |
|
Total: |
14.007 |
6.871.424.911 |
|
Folder: |
2.294 |
- |
|
Junction: |
0 |
- |
|
Symlink: |
1 |
- |
|
|
|
|
Overall |
|
Times: |
00:00:06.171 |
The --truesize option does not return info on alternate data streams right now.
|
|
Quotes
around path
|
If there are blanks in the argument path to ln.exe, the pathname has to be put under quotes, e.g.
ln --copy "x:\dir with blanks\dir2" "y:\destination with blanks\newdir"
Please make sure not to end a quoted path with \ because ln.exe treats this
as escaping of the quote (\") and can not parse the command line.
ln --copy "x:\" y:\dir\newdir
|
|
|