Question : Piped output to GZIP file->adding date stamp to file name

I am using mysqldump in a cron job to create a backup of my database. I need to timestamp the gzip output files. How would I do this?

Here's code to mysqlbackup.sh:
1:
2:
mysqldump --defaults-extra-file=/home/my_server/backup/my.cnf db_name | gzip > "/home/my_server/backup/mysqlbu_db_name.sql.gz" 2>>"/home/my_server/backup/logs/Errorlog.txt"


I essentially want something like this:
mysqlbu_db_name_07072010.sql.gz (for a file created today)

Answer : Piped output to GZIP file->adding date stamp to file name

AFAIK, there's really no "great" solution for this.  A workable hack is to *keep* the bind's in place, but populate the initial values manually.  So the lists will show the correct default values initially, but will still be linked.

Use cfinvoke to get the initial data for each list
       
       <!--- change the parameter names if needed ...--->
      <cfinvoke component="com.remoteCalls" method="getRemoteProvince"  
                      countryId="#countryid#"
                      returnVariable="getProvinces"
          >
       ... run other methods ....

Then use the results to populate each cfselect manually. Again, *don't* remove the bind's or the lists won't be linked properly.

<cfselect name="province" bind="cfc:com.remoteCalls.getRemoteProvince({countryid})" ... etc....>
        <option value="0" selected>Select One</option>
       <cfoutput>
       <cfloop array="#getProvinces#" index="row">
      <option value="#row[1]#" <cfif row[1] eq provinceId>selected="selected"</cfif>>#row[2]#</option>
         </cfloop>
       </cfoutput>
</cfselect>

       ... populate other lists ....


BTW: Binds are great for "add new" forms, but lousy for "edit" forms IMHO.  Especially when you have a lot of related selects.  What you're trying to do is simulate the onchange event for each cfselect list.  That's easy enough.  But to get the desired results, you have trigger them in a *specific*order (ie synchronous) Otherwise, the lists won't contain the right items.  

Also, CF8 binds don't support "selected". So even if you figured out how to populate each list with the desired items, you can't easily preselect one of the items! It's a pain, but it's a known limitation of in CF8.
Random Solutions  
 
programming4us programming4us