Whenever I dump a database out to a file, I always like to have it named sensibly: example-20130718-1523.mysqldump. Having a consistent name for the database dumps helps keep them in order, and helps me to clear up unneeded files at the end of jobs.

I use Textexpander in my day to day work, and generating dumpnames is done by a Textexpander snippet:

To break this down:

The %fill:name% means Textexpander will prompt me for a string to use here.

The %Y, %m, %d, %H, and %M are “year as four digits”, “month as two digits”, “day as two digits”, “hour as two digits”, and “minutes as two digits” respectively.

I use the suffix .mysqldump to separate large dump files from smaller .sql scripts, so I can exclude the larger files from searches across files when necessary to speed that up.

N.B. Though I’m using Textexpander, you could have a similar shortcut for various other tools, e.g. Alfred.

(Photo: Dymo “P”, © Paula Bailey)

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.