One of the common tasks people use zsDuplicateHunter for is cleaning up multi-user systems where files are shared among users. When you are working with a multi-user system, you may not want to completely remove a duplicate file because the user to whom the file belongs will expect the file to be in the original location.
The Enterprise edition of zsDuplicateHunter contains the ability to replace a file with a link. When you replace a file with a link, your users can work with the file as normal. In most cases, the file will appear as though it has not changed to your user.
This example will walk you through the process of creating links to files using zsDuplicateHunter. If you would like to follow along with this example, you can use the sample data provided by Zizasoft. If you received zsDuplicateHunter on CD, the sample data is in the How to Link folder within the zsDuplicateHunter Sample Files folder on the CD. If you downloaded zsDuplicateHunter, you can get the sample files from http://www.zizasoft.com/products/zsDuplicateHunter/samples.html .
First, we need to setup the information about how to the links should be created. To setup the linking rules, open the options dialog by pressing the Edit Options button. With the Options Dialog open, select the Link Creation Rules tab. First, enable the Link Creation by checking the Enable Link Creation checkbox. Next, we will need to create a rule which maps source directories to destination rules. To add a rule, press the Add Rule button. You will be prompted for the source directory for the rule. On a multi-user system, the source directory will be the user directory, or a sub-folder within the user directory. For this example, select the user 1 folder in the samples directory and select the OK button. You will now be prompted for the destination directory. This is the folder that the original file will be placed in. For this example, select the Shared folder in the sample files directory. There are several options that you can set for the rule. The first option is whether or not the rule applies to sub-folders within the source directory. The next option is whether or not to preserve the structure of the source directory when deleting files. The final option is what to do if a file already exists within the destination folder with the same name as the file being deleted. For this example, we will leave the options at their default values. If you make a mistake entering a directory name, you can change it by double-clicking on the directory. Now, setup a second rule using the User 2 directory as the Source and the shared directory as the destination. All options can be left as the default again.
When you have finished, the screen will be similar to the following.
Now that we have created the rules, we can continue with our duplicate hunt. Close the options dialog by pressing the OK button.
To start the duplicate hunt, first remove any folders which are selected to be searched. To remove the folders, first select the folder and then press the Remove Selected Folders button. We will now select the folders to search. Select both the User 1 and User 2 folders in the sample data.
For this duplicate hunt, we will use the Exact Duplicates Using Digest - Show Unique Files . This set of options will group duplicate files by content, and it will also show any unique files in the results so we can work with them as well. Your screen will be similar to the following.
After you have selected the correct options, press the Start Duplicate Hunt button.
Let's quickly review the results to form a strategy for replacing the files with links. We will start by looking at the results by path. As you can see, the two user directories contain the same basic structure. Each user directory contains a personnel directory with company wide memos End information. This information does not change from user to user so we will make sure that each used shares the same information. Each user also has several project folders which contain information about the projects being worked on. The ABC and AFA projects seem to be being worked on independently, but the XYZ project is being worked on jointly. When setting up the links, we will need to ensure that each user's information is correctly preserved. ZsDuplicateHunter helps us with this.
Let's start with the personnel folder as that is the most straight-forward. First, we will need to open the personnel folder and select the three files in the personnel folder. You can use either the User I or User 2 folder. Now, select the Replace Selected and Duplicates of Selected With Links command. This command will remove all of the files in the personnel folder with links to a new personnel folder in the Shared directory. Because the files are the same in both the User 1 and User 2 directories, both directories will be cleaned up at once.
Because the AFA and ABC projects are not being worked on at the same time, we will leave them alone.
Let's now work on the XYZ project. First, make sure that all files are visible by selecting Show All Files in the View menu. Now, open the XYZ project folders for both users.
As you can see, the Project Scope document is the same for each user, but the Project Plan is different in each user folder. In most cases, you would simply want to ensure that the users are aware of the issue and allow them to correct the problem themselves. However, we will take the opportunity to look at some of the more advanced features of link creation. Based on our knowledge of our users, User 2 is in charge of the XYZ project so we would like to give User 2 the documents for the project and allow User 1 to have links to the master copies.
Let's start by cleaning up the Project scope document as that is the easiest. First, select the Project Scope document in the User 2 folder. With the Project Plan selected, select the Replace Duplicates With a Link to Selected command and then start the command. This command will replace any duplicates of the selected file with a link to the file. So, in this case, user 1 will receive a link to the file in the User 2 folder.
Now, we can work on the Project Plan document. To replace the Project Plan file in the User 1 folder with a link to the User 2 folder, we will first want setup a new link creation rule. To do this, first open the Options dialog and navigate to the Link Creation Rules tab. Now, add a rule with the User 1/XYZ project as the Source directory and the User 1/XYZ project as the destination directory. We will want to set the Conflicting File option to enforce that User 2 should have the most up to date version. There are three options that make sense for our situation. The first option is link to destination which will delete the version in the User 1 folder and create a link to the User 2 directory, the problem with this is that any changes User 1 has made will be lost. The second option which is appropriate is the Use Latest Version option which will select the latest version based on the times that the files were last modified. The final method which is appropriate for our situation is the Add Version Number to File option. this will store both copies of the file, but it will add a version number so that the files can be distinguished from each other. For this example, lets use the versioning option. Now that we have setup this rule, we need to move it to the top of the list. The rules are evaluated in order and we need to ensure that the new rule is used rather than the original rules we defined.
Now that the rule is defined, we can delete the file from the User 1 folder. To perform the deletion, first select the Project Plan document in the User1/XYZ project folder and delete the file using the Delete Selected Files method. |