I don't care who started it. I'm finishing it. And by "it," I mean your unfinished web site.
I don't care who started it. I'm finishing it. And by "it," I mean your unfinished web site.
Yet another thing I hate to do by hand is create backups of my database on demand. I hate giving them names, and I hate typing out a long linux command to get it done. However, when upgrading to a new version of drupal, or making any big system change, it's important to have a working database backup.
Our savior, yet again, is a function written to our .bashrc file.
function sqldump { date=`date +%Y%m%d.%a.%H%M%S` mysqldump -h [mysql server hostname] -u [your username] -p [database name] > ~/path/to/backup/directory/$date.sql }
Just punch in sqldump, enter your MySQL password when prompted, and the script does the rest. The date format I selected gets appended as a reference to the file name. For example, today's date is Monday, January 4th, 2010, and the time is 11:08 AM and 14 seconds. The filename would be 20100104.Mon.110814.sql. Of course, this is my personal preference. A wide variety of tokens for datestamps are available.