First, get 7zip Command Line here.
Next, unzip to your desired directory – mine is in
Based on my previous post, MySQL: Backup Database using Batch File. Add the following lines after
echo Database Backups Completed and before
cd C:\7za920 7za a myapp_db_%datestr%.zip D:\BACKUPS\myapp_%datestr%.sql >Log.txt 2>&1 echo Zipping Backups Completed
Now you are done! Execute the batch file to see the result!
>Log.txt 2>&1 used for creating a log file for all the process to zip the file.