Posted on 05-03-2018 03:29 AM
Hi,
So finally getting rid of an old Xserve, the data is being moved to new Windows Servers.
Does anybody have a script that I can run on Snow Leopard Server that can tell me all the files and folders with over 256 characters as this will cause issues with the Robocopy.
Thanks
Posted on 05-03-2018 03:58 AM
If you are moving from a macOS file store to a Windows file store you will run into more issues than just the character limit. The Mac lets users have leading and trailing spaces it also doesn't stop them using / : * ? " < > % | in their file names. We have a script in Self Service to let users fix their file names, before the files are moved to OneDrive or our fileserver. I'm not sure I would want to run it as is against a server, but it might help you out.
Posted on 11-07-2023 02:47 AM
Here is a script that you can run on Snow Leopard Server that can tell you all the files and folders with over 256 characters:
find / -type f -name "*" -exec du -h '{}' \; | awk '{if (length($NF) > 256) print $NF}'
find / -type d -name "*" -exec du -h '{}' \; | awk '{if (length($NF) > 256) print $NF}'
This script will first find all files with over 256 characters and print their names to the console. Then, it will find all directories with over 256 characters and print their names to the console.
Or you can use a tool like Gs Richcopy 360 or Long Path Tool to handle this issue easily.