mirrorlinks, by Rudd-O
============================

description: mirrorlinks: mirror directories using symbolic links

mirrorlinks is a small bash and python combo script that automatically mirrors the contents of a directory into another directory using symbolic links, so you don't waste unnecessary disk space in copies.

This is better explained by example, of course:

- You have directories `Music`, `Movies` and `Shared`.
- You want to mirror both the contents of `Music` and the contents of `Movies` into `Shared`.  For some specific reason, you don't want to place links to `Movies` and `Music` into `Shared`,

With mirrorlinks, that's easy to do:

mirrorlinks Music Shared
mirrorlinks Music Movies

Now `Shared` has the contents of both the Music and Movies directories.  To be more accurate, `Shared` has the directory structure of both `Music` and `Movies` merged into one single directory, with symbolic links pointing to the actual files.  So if you had files into `Music/ATB`, `Shared` would contain a folder named `ATB`, and this folder would contain links to the files in `Music/ATB`.

##Notes and frequently asked questions

- mirrorlinks creates absolute symlinks.  If you want relative symlinks, see below.
- any directory named `.svn` is automatically skipped.  Thus, you can check in an entire merged directory full of symlinks into Subversion, and not have it choke or do wrong things.

###Why does your script use symbolic links instead of hard links?

Two big reasons:

1. Hard links don't work across filesystems.
2. You can't check hard links into Subversion repositories.

###I'm merging several directories into one, and mirrorlinks is refusing to continue because it says that a file already exists in the target directory

mirrorlinks, by default, won't crush existing files in the destination directory (to prevent data loss).  Thus, merging two source directories with files or directories in the same structural locations can be problematic.  To instruct mirrorlinks to remove matching files and folders from the target directory, you can specify `-r` as the first command-line argument.

##License

GPL, of course.
