“P”, © Paula Bailey

Dumpnaming

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:
%fill:name%-%Y%m%d-%H%M.mysqldump

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 Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>