Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Directory & Contents Comparison for Mac

Thread Tools
 
Search this Thread
 
Old Dec 30, 2013 | 04:05 AM
  #1  
GC8's Avatar
GC8
Thread Starter
Scooby Regular
 
Joined: Aug 2003
Posts: 17,582
Likes: 0
From: Sheffield; Rome of the North
Default Directory & Contents Comparison for Mac

Can anyone suggest a utility or method to compare directories and their contents?

I have transferred about 70GB or MP3/FLAC audio from an external fixed disk to a Mac (G4 10.5) and it failed with about 2GB still to copy (due to a bizarre permissions error).

Due to the number of subdirectories and files involved Im looking for a utility which will compare the directories, subdirectories and their contents on the duplicate with the orginal, so that I am able to identify which directories are either missing or incomplete.

Any helpful suggestions appreciated.
Reply
Old Dec 30, 2013 | 02:08 PM
  #2  
Markus's Avatar
Markus
Scooby Regular
25 Year Member
 
Joined: Mar 1999
Posts: 25,080
Likes: 0
From: The Great White North
Default

A few things spring to mind:
http://www.kaleidoscopeapp.com
http://www.araxis.com/merge/index.en

The former is a very funky bit of software (even does image comparison too), it will allow you to compare a folder structure from one disk to another.

I'm not sure if the following will be of use. I have a Media external and a Backup external and I typically backup the Media folder to the Backup drive. I usually forget what I've put on the Media drive, and I've deleted the odd thing here and there, so was looking for some way of copying over only the missing / changed items, and NOT deleting items on the backup that are not on the Media drive.

I had been using the aRsync app, but it kept giving me permission errors and the log was non existent, so I decided to learn a bit about rsync, and through doing so, I have a script that will check the Media drive against the Media folder on the backup drive and only copy over the new / changed items. Default mode is to print out the differences, i.e.; what will be copied.

It sounds as though that might be what you'd want, i.e. check the external source against the internal destination, display what wasn't copied, and then you can dig in and fix permissions, or just get it to copy over just those items.

Here is the script:
Code:
#!/bin/bash
unique_name=`date "+%d_%m_%Y_%H%M%S"`

# rsync command
# Options are
# a = preserve permissions
# r = recurse directories
# v = verbose
# n = dry run - suppressed for real runs
# W = copy whole file
# x = preserve extended attributes
# t = preserve modification times
# e --ignore existing = skip existing files on destination
# exclude-from = file containing files and folders to exclude from check; eg; ds_store files

# Path to source folder.
the_source_folder_path="/Volumes/Media"

# Path to destination folder.
the_destination_folder_path="/Volumes/Backup/"

if [ "$1" != "" ] ; then
	clear
	rsync -a -r -v -W -x -t -e --ignore-existing --exclude-from='/usr/bin/mrw-rsync/rsync-media-exlusions.txt' "$the_source_folder_path" "$the_destination_folder_path" 2>&1 | tee $HOME/Library/Logs/mrw-rsync/mrw-rsync-media-$unique_name.log

else
	clear
	echo "---- DRY RUN ----"
	echo "---- PRINT TO SCREEN ONLY ----"
	rsync -n -a -r -v -W -x -t -e --ignore-existing --exclude-from='/usr/bin/mrw-rsync/rsync-media-exlusions.txt' "$the_source_folder_path" "$the_destination_folder_path"

fi
Basically, if you whack that into a file, save it as "something.bash" and then fire up terminal and "chmod +x" it, you can execute it using ./NameOfScript.bash
If you copy it to /usr/bin (need to use sudo) then it's avaialble to all shells and can be run by just typing NameOfScript.bash

The two things you would want to change are:

the_source_folder_path="/Volumes/Media"

Change "/Volumes/Media" to the path to the folder on the external that contains all the files / folders

So the same thing for:

the_destination_folder_path="/Volumes/Backup/"

Changing "/Volumes/Backup/" to the path of the folder on the internal disk where the files and folders are copied into.

I'd guess you would be changing the_source_folder_path to something like "/Volumes/External/Music" and the the_destination_folder_path to "/Users/username/Music"

Here's the exclusion file that is mentioned:
Code:
.DS_Store
.Spotlight-V100/
.DocumentRevisions-V100/
.TemporaryItems/
.Trashes/
.fseventsd/
There are items to be excluded, as you don't need the ds_store files from all of the sub-folders being copied.
Reply
Old Dec 30, 2013 | 11:16 PM
  #3  
GC8's Avatar
GC8
Thread Starter
Scooby Regular
 
Joined: Aug 2003
Posts: 17,582
Likes: 0
From: Sheffield; Rome of the North
Default

Thank you.
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Wish
Computer & Technology Related
3
Sep 30, 2015 10:39 PM
Littleted
Computer & Technology Related
0
Sep 25, 2015 08:44 AM




All times are GMT +1. The time now is 07:44 PM.