RedditPP Mascot

RedditPP

r/talesfromtechsupport • … • u/lemabeuf

I made a fool-proof directory generating script for my workgroup. Enter the sudo fool....

My supervisor and I were discussing implementing a better directory structure for our group (Read: Any structure), as we use a shared linux cluster for our data analysis and it's impenetrable to anyone other than the creator (Doctor's handwriting style). On paper I sketched out a hierarchy for raw data, processing, results etc, a folder link out to the FTP site and automated back-ups of core directories, and in my personal opinion it was tight.

All was accepted so I set about writing a perl script to create the directories, ask a few questions to generate a readme, and I was locking that shit down permissions-wise (yes, I know it's not the best way to do it but it's my easiest language). The end users are typical non-linux users so to make it simple fixed directories were non-removable but writeable by the owner, read and executable by the group. I learned about [sticky bits](http://en.wikipedia.org/wiki/Sticky_bit) whilst doing this which excited me greatly.

Basically, it was perfect. Well, it wasn't, but it was functional and without telling me, my supervisor started generating the structures and moving files into it. You may see where this is going...

He told me later that week that he'd transferred everything in (around 8TB moved, not copied)). This is how conversation went:

**Me**: Wasn't it annoying having to create the files for each user?

**Boss**: I just made them myself.

**Me**: Ah... Sorry, I should have explained. No-one will be able to work on their data that way, as you own it. We'll need to change the owner permission individually to make sure it works correctly.

**Boss**: Oh, no that's fine, I fixed it. I just ran sudo chmod -R 775 * .

Me: ..............

— 0