Solved

Mac - rsync folders with / in name

Posted on 2016-09-29
5
96 Views
Last Modified: 2016-10-10
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?
0
Comment
Question by:willp2
  • 2
  • 2
5 Comments
 
LVL 53

Accepted Solution

by:
strung earned 500 total points
ID: 41822435
A slash in a file or folder name is legal on the Mac file system, but illegal in Fat and NTFS. So if you are copying to a FAT or NTFS drive, you may have to do a global search and replace, changing the slashes to something else, like underscore, for instance.

There is a Mac utility, "A Better File Rename"   http://www.publicspace.net/ABetterFinderRename/ which can easily bulk rename files and folders.
0
 
LVL 1

Author Comment

by:willp2
ID: 41822659
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.
0
 
LVL 53

Expert Comment

by:strung
ID: 41822664
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.
0
 
LVL 29

Expert Comment

by:serialband
ID: 41822924
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
0
 
LVL 1

Author Closing Comment

by:willp2
ID: 41837193
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.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
linux 13 76
Keychain won't accept new passwords that are told to be added to it. 7 51
trouble on installing syslog-ng on CentOS 7 7 57
Unix Help with:  mailx -s 15 17
Syslogd is a utility that traps and logs messages sent by running processes. It is configured with the syslog.conf file, which consists of lines containing a pair of fields: "the selector field which specifies the types of messages and priorities to…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question