Skip to content

SmartCopy

SmartCopy is a utility I really never expected to have to write myself.  It’s function is to manipulate files in a large, deep directory structure selectively and (hopefully) intelligently.  Operating systems’ native interfaces all seem to do a poor job of this, and the alternative tools I’ve tried all seem flawed one way or another.  I hope SmartCopy provides an improvement on existing utilities – it certainly fills my needs better than anything I’ve tried.

To download SmartCopy, please visit the project site at SourceForge.

What are the functions that SmartCopy provides?  It’s basic job is to provide selective backups of a directory structure.  I initially wrote it to help populate a small mp3 player (20gb) from a very large mp3 collection (500gb) – a task which seems unnecessarily difficult using Windows Explorer (for example).  Perhaps I have an uncommonly large media collection, or perhaps I organise it rather more obsessively than others, but it does surprise me that this task does not have a wealth of utilities designed to make it as efficient and painless as possible (I count iTunes as an example of an extremely bad utility for the purpose).

The more general case I use the tool for is maintaining backups.  I backup parts of my collection on to a variety of devices – large stores for permanent backups, portable drives for mobile libraries, etc.  It also useful for general organisation and maintenance of any large collection of files.

An example usage would be maintaining an incremental backup.  The steps involved in this would be:

1.  On startup, select the directory you wish to backup (source).

2.  Use the ‘Filter Mirrored Paths’ option and select your target directory.  This will compare the directories, and filter out any files/folders already present in the target from the source view.

3.  Select all files and folders which remain by checking the root node of the source view (all subfolders and files will automatically be checked)

4.  Use copy selected files to transfer any new files (and any modified files, if ‘Allow Overwrite’ is checked and ‘Ignore Size’ is not)

5.  Use ‘Find Orphans’ to locate any files in the target which are not present in the source (this automatically switches the view to the target folder)

6.  Select the root node and use ‘Delete Selected Files’ to eliminate them.

Filtering mirrored files and folders

Filtering mirrored files and folders

These steps are common enough as a process that there is a single command in the menu which performs exactly those operations – ‘Synchronise Directory’.  With a little imagination, the individual operations combined with others and filters can be used to perform more interesting operations, e.g. to split a mixed media directory into separate trees for audio and video, or to backup, move or delete only those files and folders which are different in the source from some other directory.

Some advantages of using SmartCopy for these sorts of operations include:

  • Comparisons and filtering are done up-front, so you know you are not going to be bothered 2 hours in to a long backup with a prompt asking if you want to overwrite something.
  • Long operations can be paused and resumed – useful if you’re doing a backup over the network and need to temporarily free up bandwidth to make a Skype call, for instance.

Removing Mirrored Paths Status

In the latest versions, your selection can be saved and restored to a text file, or in an extended format compatible with m3u playlists.  This makes SmartCopy a very useful tool for building playlists to sync with an ipod (or other media player), allowing whole albums and artist collections to be selected with a few clicks, and showing you how many files will be copied and what their total size is, to make sure your mp3 player is just as full as you want it to be.

The original version of the tool was written in Python back in 2007, when cross-platform compatibility seemed important to me.  However, I found that Python’s cross-platform capabilities did not out-weigh the inconvenience of not having Python installed on other machines I wished to copy parts of my media collection on to when I was travelling.  Since I wanted to learn some C# and .NET, I decided that converting SmartCopy to that platform was a useful exercise with a practical end product.  Hence, the latest version is written in C# and targetted for .NET runtime 4.0.

20 Comments
  1. How do you compare this with tools like Robo Copy. I am really trying to understand the purpose. Please do not take my words otherwise but I want to review this and looking for strong points when compared to other tools.

    • Hi Ashish, some advantages that SmartCopy has over RoboCopy:

      - Tree structure makes it quick and easy to copy only a part of a structure
      - Up-front comparison (removal of mirrored paths) allows you to quickly see which files are ‘new’, and which already exist in the target
      - When you select the paths to copy you can see how many MB/GB will be copied before you start, so you can make sure you’re not going to run out of disk space
      - Filters and selections allow you to copy only the files you want (e.g. copy mp3 files but not FLAC, jpg etc)
      - Find orphans allows you to check for any files in the target which aren’t in the source, and selectively choose to delete them, copy them back to the source, move them to another directory or leave them where they are

      Plus, the new feature to export your selection to a txt or m3u file allows you to make a playlist which can easily be synced to your ipod, a process which itunes and other tools I’ve tried makes very laborious.

      To the best of my knowledge there’s no other tool which provides the same power and flexibility, whilst maintaining a simple and streamlined user interface.

  2. Hugh Macmillan permalink

    Dear Simon,

    I read about this tool on ghacks. I decided to give it a whirl as I am currently moving and copying a large number of files between partitions.

    My first experiment was successful. I copied a directory with sub-directories full of portable document files (PDFs) to another partition with a folder entitled PDF freshly created for the expperiment.

    The second experiment was not so successful. I found a large number of PDFs which had no folder and decided to try the filter option – *.pdf. I saw the PDFs all in the right hand pane which I wanted to copy and chose to copy them to the PDF folder mentioned above.

    This was successful to a certain extent. The files were all copied over but they did not enter the PDF folder. They were all copied like this with a prefix of PDF on the file name.

    For example the original file screenplay.pdf appeared as PDFscreenplay.pdf in the target folder.

    I’m sure I am doing something wrong. Can you advise me please?

    Much thanks for the program,

    Hugh

  3. Hi Hugh, thanks for the bug report, which was caused by a difference in the way Windows treats files in the root directory of a drive, which I’ve now compensated for. There is a new version on Sourceforge which addresses it.

  4. mike permalink

    Hello Nice tool that “works”/ Thanks.

    You should know that this too is also good for copying directories to many Virtual Machines.

    On your next version I’d like to see a way to add multiple destinations such as

    Source: C:\MyFiles

    Destination: VM1\C:\MyFiles
    VM2\C:\MyFiles
    VM3\C:\MyFiles
    VM4\C:\MyFiles
    VM5\C:\MyFiles

    Also a Way to Save my work so I don’t have to repeat this.

    creat a post on VirtualBox.org , or older MS Hyper V.

    This has been exactly what I’m looking for thanks.

    mike

  5. Athe permalink

    Great tool!!! In addition to mikes suggestion, if we could add a multi source to single destination setting. use case: i have multiple students submit files on individual USB sticks and would like to copy specified folders and /or files to a single destination in an automated way. the files are normally named with the student’s ID number to avoid clashes.
    extending this to deal with contingencies/other uses will be to include settings to deal with multiple identical named source files. e.g. when several students name it ‘assignment1.doc’ instead of their id – by providing an option to auto re-name on the fly by appending a number/letter of my choosing. Another use case may be collecting only the latest/biggest version of files from multiple source drives to a destination folder so a few different options will help there too (e.g latest modified date, a specific date or date range, specific file size or range, biggest etc).

  6. Don permalink

    Aloha, I don’t see an option to filter by date – I would like to copy files that are over three years old to a new folder/subfolder. Am I missing something?

    • Hi Don, there isn’t currently any option to filter by date… I don’t tend to find Windows timestamps reliable enough to be useful, so haven’t ever felt the need to add functionality relating to them. I’ll have a quick look to see how hard it would be to add something though :-)

    • The new version has the option to filter files which fall outside a desired date range… it can be applied multiple times to hone in on the exact date range(s) you want :-)

  7. Raphito permalink

    Hi Simon
    Great tool, thank you very much! Every time when I copy files to my windows phone I think “damn, I have to write a useful tool so I can do it more efficent”… RichCopy is a good choice too, but it is not very userfriendly.
    Unfortunately your tool cannot copy directly to a memory card installed in my windows phone and connect via USB (RichCopy isn’t able to do that too). I simply cannot select any folder on the phone with the dialog. Do you have any idea why this is? My first thought is that maybe windows uses some special URI to address the phone. Maybe I try to debug the code when I find some time. I have seen it is public RO rights on the SVN.
    Regards and thank you!

    • Hi, glad you’ve found it useful :-) Not sure about the Windows phone issue, don’t have one to investigate I’m afraid. If you can find a solution please get back in touch – I’m happy to have other contributions to the project, so I will grant write access to the repository if requested.

  8. Marc G permalink

    Strongly suggest you change ‘remove’ to ‘hide’ !!!! I keep freaking out that it is removing files in my source folder!!!

  9. Thanks Mike, a good idea… I’ll have to dust off the source code and add a ‘batch update destinations’ function soon :-)

Trackbacks & Pingbacks

  1. Smart Copy, copiare file da cartelle di grosse dimensioni | IdeaGeek.it
  2. Smart Copy : Copy Pause & Preview Conflicts before copying Deep directory structure
  3. SmartCopy te Permite Copiar Grandes Cantidades de Archivos | POWERPYMES
  4. Simon’s Blog « machinewrapped
  5. SmartCopyTool – un tool per eliminare spostare i files

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 153 other followers

%d bloggers like this: