cleaning up
Bradley Giesbrecht
brad at pixilla.com
Mon Jan 11 16:22:00 PST 2010
On Jan 11, 2010, at 3:55 PM, Jeremy Lavergne wrote:
>> I'd rather not remove directories so I replace rm -rf with rm -f.
>
> Why not avoid directories all together and use -type f in find?
Much better. That's what I ended up with.
>> The thing I don't like about this approach is what if I have a
>> database named mp_somedb or mp_somedb.mp_sometable in /opt/local/
>> var/db/mysql5/?
>>
>> To be safer yet is the timestamp always x digits long? I'd rather
>> use [0-9]{10}.
>
> Likely they are all the same size.
>
>> I don't really think there is any safe way to do this. I'd like to
>> see port keep track of these renames in a registry.
>
> Well, the best way to be clean up anytime you do a force activate.
> Having a naming scheme overlap isn't exactly MacPorts' fault. You
> could name your db /opt/local/bin/port for we know.
True, it's not MacPorts' fault. Nor is it my fault. It's not practical
to safely avoid .mp for the beginnings of all things. Users can create
imap mail boxes and name them what they like.
I just want to safely remove a slug of files that MacPorts put on my
system and then forgot about. Those files are there because at times
it's been the only way to get things installed/upgraded using
MacPorts. I'm happy that MacPorts didn't just clobber them but at some
point I think I want these removed from places like $prefix/bin/*.mp*.
I'm just looking for an easy and safe way to do this and find -name
*.mp* rm scares me. It's easy but not safe.
>> I would really need to move all my data (apache, dovecot, postfix,
>> mysql ) outside /opt/local to feel safe with a "find . *.mp* rm"
>> approach.
>
> Don't name anything with mp in it? Backup?
Restoring from a backup is a terrible solution. I make nightly backups
of my databases but loosing a days worth of data will make me very
unpopular.
Likewise losing all the emails in an imap mailbox would make me
equally unpopular. I think for me it's best to just move user data
outside /opt/local. I already moved it all to a subdir of /opt/local/
var I should have just moved it outside /opt/local altogether and I
wouldn't be worried about find $prefix -exec rm commands.
// Brad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20100111/d3db2570/attachment.html>
More information about the macports-dev
mailing list