Current location: Hot Scripts Forums » Other Discussions » Database » auto mysql database backup in windows xp


auto mysql database backup in windows xp

Reply
  #1 (permalink)  
Old 06-29-08, 08:41 AM
triplebig triplebig is offline
Newbie Coder
 
Join Date: Nov 2007
Posts: 83
Thanks: 6
Thanked 0 Times in 0 Posts
auto mysql database backup in windows xp

is there anyway to do automatic backup of all my database in windows xp ?

as example at 5pm backup all the database to my specified folder or to other computer (in network)

right now i do it manually through phpmyadmin...mysql dump
Reply With Quote
  #2 (permalink)  
Old 06-30-08, 03:02 AM
triplebig triplebig is offline
Newbie Coder
 
Join Date: Nov 2007
Posts: 83
Thanks: 6
Thanked 0 Times in 0 Posts
i have figured it out myself...using a batch file + task scheduler

PHP Code:



@echo off
echo Creating Backup...
for /
"tokens=1" %%i in ('date /t') do set DATE_DOW=%%i

for /"tokens=2" %%i in ('date /t') do set DATE_DAY=%%i
for /%%i in ('echo %date_day:/=-%') do set DATE_DAY=%%i
for /%%i in ('time /t') do set DATE_TIME=%%i
for /%%i in ('echo %date_time::=-%') do set DATE_TIME=%%i

c
:\xampp\mysql\bin\mysqldump -u root  --result-file="c:\%DATE_DAY%_%DATE_TIME%_nameofdatabase.sql" nameofdatabase
echo Finished
now I'm still trying to backup to other computer
Reply With Quote
  #3 (permalink)  
Old 09-11-09, 01:03 AM
triplebig triplebig is offline
Newbie Coder
 
Join Date: Nov 2007
Posts: 83
Thanks: 6
Thanked 0 Times in 0 Posts
i posted the code above last year and i want to use this backup method in my new project


...and i just notice the \ is gone in the code..let me try the quote button


Quote:

@echo off
echo Creating Backup...
for /f "tokens=1" %%i in ('date /t') do set DATE_DOW=%%i

for /f "tokens=2" %%i in ('date /t') do set DATE_DAY=%%i
for /f %%i in ('echo %date_day:/=-%') do set DATE_DAY=%%i
for /f %%i in ('time /t') do set DATE_TIME=%%i
for /f %%i in ('echo %date_time::=-%') do set DATE_TIME=%%i

c:\xampp\mysql\bin\mysqldump -u root --result-file="c:\%DATE_DAY%_%DATE_TIME%_nameofdatabase.sql " nameofdatabase
echo Finished!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
mySQL database backup blinn_shade PHP 3 10-18-07 12:48 AM
PHP installation can not load Mysql extension on Windows XP abtimoteo Web Servers 4 09-26-07 08:59 AM
Full MySQL Database Backup someotherguy582 Database 2 06-22-06 12:30 PM
MySQL Database Backup & Restore (PhP Script) KeYBLeR Script Requests 5 04-01-06 11:00 PM
UPDATE: MySQL Auto Backup & Export v1.1 Beyonder General Advertisements 2 03-21-05 02:05 PM


All times are GMT -5. The time now is 05:03 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.