Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Listing all files and folders by file path

Due to an issue with our Backup Software struggeling to cope with any file paths that are longer than 150 charecters in length (Awesome, I know!). I am looking for a way to list the full file paths for the files and folders stored on a particular disk so that I can work through and move any files that are longer than this to a seperate backup job.


I have searched for the answer and so far I can't find a sensible way to achieve this.


Any help would be greatfully recieved.

Xserve, Mac OS X (10.6.8)

Posted on Nov 21, 2012 2:50 AM

Reply
7 replies

Nov 21, 2012 5:18 AM in response to EdInDaClouds

Thanks both for your replies.

@LousyFool: This will help if I have to manually vist every folder. I was hoping to be able to list all of the files and folders and then attack them from there.

@etresoft: Frustratingly this is an issue with Symantec's Backup Exec for Mac Agent. In an attempt to bring it into line with the rest of our corporate backup solution I am currently troublshooting the issues associated with it.

Nov 21, 2012 5:33 AM in response to EdInDaClouds

Hmmm. There seem to be even no decent 3rd-party programs to give you a complete tree view or list of folders, subfolders and files.


Here's how to get to see at least the folder/subfolder structure:


In Terminal, maneuvre first to the drive and directory you want to explore.


Then copy and paste this line and hit return:


ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'


The result is at least the complete "tree" under that directory, but no files. You can copy and paste it into whatever other app that takes text.

Nov 21, 2012 5:44 AM in response to EdInDaClouds

Automator might be able to give you a report of what is too long.


You could use Applescript or Python to quickly make a little program to find problem files and move them someplace else.


I would use Python because then you could use it on ANY of your company machines to check for this problem before a backup is run.


python.org for more info, or ask questions.

Nov 21, 2012 6:42 AM in response to EdInDaClouds

From an Applications -> Utilities -> Terminal session, enter


cd /Starting/Directory
find .  ! -type d | awk 'length() > 150 { print }'


The "! -type d" will exclude any path which ends in a directory. If you want to see those as well, remove the "! -type d"


The 'awk' expression will print any path that is longer than 150 characters. You can adjust the 150 comparison value depending on what works for you.


PS. You might either look into using a different backup utility, or if this is your companies product, have a long discussion with the developers about why it is substandard :-)


Message was edited by: BobHarris

Listing all files and folders by file path

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.