Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Country Specific / UK Mac Group / May 2008



Tip: Looking for answers? Try searching our database.

Copying files

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rob - 15 Mar 2008 13:27 GMT
Every so often I'll back up PC work files on a CD or USB stick and copy
them to my iMac at home - about 500MB. I use a labyrinthine directory
structure. Following a disaster a year or so back, when I realised the
copy/replace actually replaced entire directories, I now create new
directories - November Backup, January Backup, and so on.

This is obviously becoming unwieldy. Apart from duplicating thousands of
files I'm having difficulty keeping track of which folder I'm working
from. Is there a way to merge all of these directories and files, so
that only the most recent is retained,  and only updated files are
overwritten?

Thanks, Rob
Jaimie Vandenbergh - 15 Mar 2008 13:41 GMT
>Every so often I'll back up PC work files on a CD or USB stick and copy
>them to my iMac at home - about 500MB. I use a labyrinthine directory
[quoted text clipped - 7 lines]
>that only the most recent is retained,  and only updated files are
>overwritten?

Leopard? Use time machine instead. Otherwise:

Doesn't the February backup have the latest of everything in it?

Otherwise, you're probably looking at a bit of terminal work. Copy in
the terminal merges rather than overwriting folders. Shout if you need
detailed instructions, otherwise 'cp -R sourcefolder destination' is
what you need. Make a new destination folder, and cp each backup
folder into it, oldest one first. That'll give you a full record of
all files, including ones you'd deleted in the intervening time.

    Cheers - Jaimie
Signature

"I love the way that Microsoft follows standards.
In much the same manner as fish follow migrating caribou."
                                              - Paul Tomblin, ASR

Rob - 15 Mar 2008 14:25 GMT
>> Every so often I'll back up PC work files on a CD or USB stick and copy
>> them to my iMac at home - about 500MB. I use a labyrinthine directory
[quoted text clipped - 9 lines]
>
> Leopard? Use time machine instead. Otherwise:

Yep, Leopard. I haven't used Time Machine, but I'm gearing up to use it
soon. Can TM merge the data I have on a CD?

> Doesn't the February backup have the latest of everything in it?

No. The problem is I work at home and work on either the same files, or
within the same directories, and I only ever want to keep the latest.
The problem is this can run to many hundreds of files over a month, and
I can't keep track. Hence the 'dumb' new directories.

> Otherwise, you're probably looking at a bit of terminal work. Copy in
> the terminal merges rather than overwriting folders. Shout if you need
> detailed instructions, otherwise 'cp -R sourcefolder destination' is
> what you need. Make a new destination folder, and cp each backup
> folder into it, oldest one first. That'll give you a full record of
> all files, including ones you'd deleted in the intervening time.

Many thanks. I do *really* need to know what I'm doing though!

I'm loathed to recall that Windows Vista has a dialogue for such matters
- replace/update/ignore. It'd be nice if a copy/merge utility existed
for Macs, and a quick google shows that many (especially ex-windows)
users have looked at this, but have yet to find an easy to implement
solution.

Rob
Jaimie Vandenbergh - 15 Mar 2008 15:16 GMT
>>> Every so often I'll back up PC work files on a CD or USB stick and copy
>>> them to my iMac at home - about 500MB. I use a labyrinthine directory
[quoted text clipped - 12 lines]
>Yep, Leopard. I haven't used Time Machine, but I'm gearing up to use it
>soon. Can TM merge the data I have on a CD?

No, there's no facility to import stuff into TM's past.

It's the most insanely easy thing in the world to use, if you've got a
large-enough external drive (or another Leopard Mac, or a Vault).

>> Doesn't the February backup have the latest of everything in it?
>
>No. The problem is I work at home and work on either the same files, or
>within the same directories, and I only ever want to keep the latest.
>The problem is this can run to many hundreds of files over a month, and
>I can't keep track. Hence the 'dumb' new directories.

I can't work out why that means Feb doesn't have the latest of each
file... or do you create a new *empty* Feb folder and then start
putting stuff in it?

>> Otherwise, you're probably looking at a bit of terminal work. Copy in
>> the terminal merges rather than overwriting folders. Shout if you need
[quoted text clipped - 4 lines]
>
>Many thanks. I do *really* need to know what I'm doing though!

This is a nice easy way to get started in Terminal, I suppose. OS X is
a full BSD Unix underneath the pretty face, so if you've got any Unix
skills then you're good (and you probably don't need this lot!). Note
that this is a simple method, rather than a clever one.

Start Terminal. You'll see something like

    Rob's-Mac:~ Rob$

which means that you're on the machine Robs-Mac, in the home folder
(~) of Rob.

Change directory to the one with all the dumb directories in.

    cd <path_to_directory>

You can type cd, then open up the folder in Finder and drag'n'drop it
into the Terminal window to save typing.

Make the new, shiny folder for everything to end up in.

    mkdir Latest

Now to copy stuff. You need to enclose in double quotes for
directories with spaces in (or July\ Files would also work, the \ tags
the following space as part of the folder name rather than a gap
between command-line arguments).

    cp -R "July Files/" Latest
    cp -R "August Files/" Latest

and so on. Once you've finished, "Latest Files" will contain all the
latest versions.

... *Unless* on occasion you've gone back and edited stuff in the
November folder during January, while there is still an older copy of
it in the January folder?

In which case, instead of using cp we need to use a slightly more
intelligent bit of software that is aware of dates on files. I choose
rsync, which is a great tool. So rather than the cp lines above,

    rsync -vau "July Files/" Latest
    rsync -vau "August Files/" Latest

and so on. You can read the rsync manual using "man rsync", but
v=verbose to show what's being copied each time, a=archive mode which
keeps all datestamps/permissions and the like, u=update mode so skip
copying if the destination already has a newer file. The update mode
is the vital trick that cp can't do.

>I'm loathed to recall that Windows Vista has a dialogue for such matters
>- replace/update/ignore. It'd be nice if a copy/merge utility existed
>for Macs, and a quick google shows that many (especially ex-windows)
>users have looked at this, but have yet to find an easy to implement
>solution.

It's solely a Finder thing, and we all know it needs f.cking Fixing.
There's no underlying technical reason why folders overwrite rather
than merging - I guess it's historical. But that wouldn't solve the
problem fixed using rsync, above.

    Cheers - Jaimie
Signature

I was most impressed when I looked up into the London sky and saw
a star through all the light pollution.  A few of us checked some
astronomy references to try and identify it, and we're reasonably
confident that it was Sol.                  -- Peter Corlett, asr

Rob - 15 Mar 2008 15:26 GMT
>>>> Every so often I'll back up PC work files on a CD or USB stick and copy
>>>> them to my iMac at home - about 500MB. I use a labyrinthine directory
[quoted text clipped - 25 lines]
> file... or do you create a new *empty* Feb folder and then start
> putting stuff in it?

I have near-identical file structures at home and at work. At work I'll
usually update a file (a lesson usually) based on a load of background
work I do at home. So there may be new/different files in each version
of the Feb folder.

>>> Otherwise, you're probably looking at a bit of terminal work. Copy in
>>> the terminal merges rather than overwriting folders. Shout if you need
[quoted text clipped - 54 lines]
> copying if the destination already has a newer file. The update mode
> is the vital trick that cp can't do.

Thanks muchly - I'll work on that this lazy grey afternoon. I used to be
pretty adept at DOS - mainly because I had to as a (flippin) windows
user/friend support.

>> I'm loathed to recall that Windows Vista has a dialogue for such matters
>> - replace/update/ignore. It'd be nice if a copy/merge utility existed
[quoted text clipped - 6 lines]
> than merging - I guess it's historical. But that wouldn't solve the
> problem fixed using rsync, above.

This has been done to a manner of death in the Mac forums. I gather it's
not all as simple as it appears ...

Rob
Jaimie Vandenbergh - 15 Mar 2008 15:38 GMT
>> I can't work out why that means Feb doesn't have the latest of each
>> file... or do you create a new *empty* Feb folder and then start
[quoted text clipped - 4 lines]
>work I do at home. So there may be new/different files in each version
>of the Feb folder.

Two sets of folders! Arr, that explains it. Sorry, I missed that
nuance.

You'll need to use rsync for sure, and to have "July home files",
"July work files" and so on to rsync in from. You don't need to rsync
them in any particular order, since each time any newer files will
overwrite older versions.

Warning: You will be susceptible to losing a file if you've made
different edits to it on the home and work tree though - the rsync
makes sure you've got the single most recent, but won't flag up
alternate valid versions...

Also, Time Machine won't merge file tree made on two machines, each TM
backup is machine:drivename specific. Something externally hosted like
a portable drive or a .Mac/Amazon S3 Internet-hosted drive might be
the way forward if you're going to carry on working on files this way.

    Cheers - Jaimie
Signature

"I went to a planet where the dominant lifeform had no bilateral symmetry,
and all I got was this stupid F-Shirt."                    -- Eric Pivnik

zoara - 15 Mar 2008 23:50 GMT
> >> I'm loathed to recall that Windows Vista has a dialogue for such matters
> >> - replace/update/ignore. It'd be nice if a copy/merge utility existed
[quoted text clipped - 9 lines]
> This has been done to a manner of death in the Mac forums. I gather it's
> not all as simple as it appears ...

It's also a matter of familiarity; people used to the Mac way get
frustrated with the Windows way, and vice versa. Personally I got stung
by the Windows way several times and hated it, before I'd even touched a
Mac; so when I switched it was a pleasant surprise to find it worked the
way I expected it to.

My understanding is that the Mac way is a deliberate design decision
based on consistency; after all, if you drop a file foo.txt into a
folder already containing foo.txt, it doesn't merge the contents of the
files, so why should it merge the contents of the folders?

Additionally - after I experimented a little after arguing about this
with people at work - it isn't even internally consistent on Windows.
Depending on which version you use, the merging only goes a certain
depth; imagine you have a folder "photos" containing a folder
"holidays", which then conatins a folder "paris". You drop a nw
"holidays" folder into "photos", which has a folder "moscow" and a few
more photos added to "paris"; the "moscow" folder gets added as you
might expect, but the "paris" folder doesn't get the new photos merged
in.

That said, I can completely see the use of 'merging folders and am
surprised some enterprising ex-Windows switcher hasn't written an app to
do it; it's not really hard at a quick-and-dirty level. For a more
comprehensive merge, you might want to check out Chronosync.

       -zoara-

Signature

"Ignorance more frequently begets confidence than does knowledge."
                                    - Charles Darwin

Jaimie Vandenbergh - 15 Mar 2008 23:54 GMT
>Additionally - after I experimented a little after arguing about this
>with people at work - it isn't even internally consistent on Windows.
[quoted text clipped - 5 lines]
>might expect, but the "paris" folder doesn't get the new photos merged
>in.

I've never known that to be the case. Do you recall what version that
limited depth appens on?

The annoying thing is that you can replicate the Finder way of doing
things by adding a step to the Windows process (start off by deleting
the destination folder), but you can't emulate the Explorer style
merging from the Finder at all.

    Cheers - Jaimie (who still wants folder tree+contents split
view in Finder)
Signature

"In the beginning, there was nothing, which exploded." Terry Pratchett

zoara - 15 Mar 2008 20:29 GMT
> Can TM merge the data I have on a CD?

No.

       -z-

Signature

"Ignorance more frequently begets confidence than does knowledge."
                                    - Charles Darwin

macfizz@gmail.com - 16 Mar 2008 11:05 GMT
> Every so often I'll back up PC work files on a CD or USB stick and copy
> them to my iMac at home - about 500MB. I use a labyrinthine directory
[quoted text clipped - 9 lines]
>
> Thanks, Rob

I have set up PsyncX on my Mac OS X Server machine (running Tiger) for
doing daily and weekly backups for each of my network shares. It works
really smoothly and has done so for nearly two years without fail.

PsyncX is quite flexible about how it does its scheduling, and it also
allows you to choose to force the backup (i.e. whether or not the file
has changed) and also whether you want to delete or keep files in your
backup that you have deleted on your disk. This gives me the
capability to get back to the latest version from either yesterday or
last week. That is fine for my purposes. With a bit of setup it sounds
as though it might suit your needs.

PsyncX is donationware.

macfizz.
--
macfizz@gmail.com - 16 Mar 2008 11:16 GMT
> Every so often I'll back up PC work files on a CD or USB stick and copy
> them to my iMac at home - about 500MB. I use a labyrinthine directory
[quoted text clipped - 9 lines]
>
> Thanks, Rob

Oh, I just thought of another thing that I also use when I need to
synchronise lots of content from a client computer to my Mac (I often
work on client sites but usually use my own PowerBook). There is a
nice cheap utility called FoldersSynchronizer. You just nominate a
local location for files and the network location, and it updates both
copies to have the latest version of all files. You can run a one-way
sync if you prefer. You can get it here:

http://www.softobe.com/products/flsy/pp.html

You can get PsyncX (see previous posting) from here:

http://psyncx.sourceforge.net/

macfizz.
--
Rob - 21 May 2008 21:15 GMT
>> Every so often I'll back up PC work files on a CD or USB stick and copy
>> them to my iMac at home - about 500MB. I use a labyrinthine directory
[quoted text clipped - 26 lines]
> macfizz.
> --

Many thanks for that - this issue has cropped up again and I'd forgotten
what was covered in this post. Your suggestion looks just the job.

Rob
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.