Yes you can. But since you said batch file, I have to assume you're using Windows. Sorry, I can't help with that.
I use mysqlhotcopy in a shell script. I hear most people use mysqldump. You should be able to run the program within a batch file. You may need to fully qualify the executable or cd to the directory.
I backup my DB on linux using a bash script. Was a pain in the rear as I wanted to back up each table into a separate file, so i've got 30 different statements running. Maybe there was a better way, but i'm not that clever.
here's the script. If you are using windows then you'd need to change the file creating bit, i guess
#!bin/sh
#This is the directory to save the log files to:
#create subfolder for todays backups
#If the directory exists for the date Y-m-d-a then...
if [ -d $backup_dir ]
then echo directory $backup_dir exists
else echo directory $backup_dir does not exist
mkdir $backup_dir
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.