Avatar of willp2
willp2
 asked on

Mac - rsync folders with / in name

Hello, we are trying to rsync several TB of data from some Mac external drives to another system. Several hundred folders have a / in the folder name. So a folder will be called things like
Accounting / Finance

I get that Mac does a translation to : and see whats happening there, but not sure how to deal with rsynch. Here are the types of errors we are getting

rsync: recv_generator: mkdir "/Volumes/Drive/Executive/Accounting : Finance" failed: Invalid argument (22)

That : between accounting and finance is a slash in the file name.

Anyone have any insight on how to get around this or perhaps another way to copy loads of info like this?
LinuxMac OS X

Avatar of undefined
Last Comment
willp2

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
strung

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
willp2

ASKER
That sounds about right. Trying out the utility you linked to. Looks like it will take several hours just to go through the data and sort through the names, but it sounds promising.
strung

Your other alternative, if it is practical, is to copy the folders to a Mac formatted drive which would not have a restriction on  the slash in the name.
serialband

The Slash (/) on unix (including OS X) is a special delimiter that's illegal as part of the file name.  It's only meant to separate folders.  Macs do a very stupid thing and allowed it way back when it wasn't unix based.  However, the command line utilities are still unix based and doesn't really handle that special character.

As someone that uses multiple platforms, I would never use those special characters in any file name.  It is an old legacy allowance that should be removed.

rsync: recv_generator: mkdir "/Volumes/Drive/Executive/Accounting : Finance" failed: Invalid argument (22)
This error suggests that OS X rsync wasn't rewritten for mac.  You might want to just try ditto for the first pass to create the folder structures and follow up afterwards with rsync once the correct folder has been created.

ditto  src  dst_directory
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
willp2

ASKER
Thanks for the input. We tried A Better File Rename and while promising, it was impossibly slow on these large drives we were working with. Hours and hours just to scan the drive.

Finally ended up using the batch rename function in El Capitan and Sierra. Not perfect and still took a lot more hands on than A Better File Rename would have, but it worked and got us past this issue.