title: Add date to mysqldump command
body: <p>I want to have my db backed up and emailed to me (the size of my db is very small so email is not problem).  I have the following mysqldump command in a cron running weekly and it is working perfectly.</p>
  
  
  
  <pre class="lang-bash prettyprint-override"><code>mysqldump -e --user=username --password=password database | gzip | uuencode database_name.gz | mail me@domain.com
  </code></pre>
  
  <p>All I want to do is add the current date of the backup to the gzip filename so each backup filename is unique.  I have searched here for the answer and found this:</p>
  
  <pre class="lang-bash prettyprint-override"><code>mysqldump -e --user=username --password=password database | gzip | uuencode $(date +%Y-%m-%d)-database_name.gz | mail me@domain.com
  </code></pre>
  
  <p>But I get this error: unexpected EOF while looking for matching `)'</p>
  
  <p>I tried a different version too:</p>
  
  <pre class="lang-bash prettyprint-override"><code>mysqldump -e --user=username --password=password database | gzip | uuencode `date +'%Y%m%d'`-database.gz | mail -s "`date +'%Y%m%d'`-database.gz mysqldump backup"  me@domain.com
  </code></pre>
  
  <p>But this also results in an error: unexpected EOF while looking for matching ``'</p>
  
  <p>Any suggested solutions would be welcome.</p>