Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Finding empty directories
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1917

PostPosted: Sat Aug 27, 2016 8:12 am    Post subject: Finding empty directories Reply with quote

Hello guys!
I had a huge bunch of music copied from my Gentoo box to a smb share. It didn't showed up any errors but unfortunately some folders are just empty at the destination. This is probably due to unsupported characters and/or the length of some paths.
The structure is like this:
/music/interpret/album
What I want to accomplish is to find all the /album folders that are empty.
How can this be done on the shell? Thanks!
_________________
"Coincidence is God's way of remaining anonymous."
Albert Einstein
"The road to success is always under construction"
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 8936

PostPosted: Sat Aug 27, 2016 8:39 am    Post subject: Reply with quote

I'm sure there is something to be done with `find`, but: can you be sure only full albums are missing, and not also single tracks? I would use rsync to make sure the task is completed, it also supports filename conversion.
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 6051
Location: Removed by Neddy

PostPosted: Sat Aug 27, 2016 9:57 am    Post subject: Reply with quote

find . -type d -empty
_________________
Quote:
Removed by Chiitoo
Back to top
View user's profile Send private message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1917

PostPosted: Sat Aug 27, 2016 11:45 am    Post subject: Reply with quote

That's a good point. I am afraid, the errors have already been deployed throughout my whole backup structure. Will try that find command for sure.
_________________
"Coincidence is God's way of remaining anonymous."
Albert Einstein
"The road to success is always under construction"
Back to top
View user's profile Send private message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1917

PostPosted: Sat Aug 27, 2016 11:48 am    Post subject: Reply with quote

That gave a reasonable result and showed some of the dirs I was already aware of.
This is imho one of the biggest downsides of rsync. If e.g. the filesystem is corrupt, you will not recognize it until it's too late. That's why I was investigating a decent cloud service, but they all seem to suck for one of these reasons: pricing, privacy, no rsync, horrible apps.
Basically I am just looking for something to keep 3 PCs on sync with certain directiries in a LAN.
_________________
"Coincidence is God's way of remaining anonymous."
Albert Einstein
"The road to success is always under construction"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum