• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Linux Mysql, ubuntu

zielok

New Member
Joined
Mar 8, 2009
Messages
66
Reaction score
0
Hello,
I'm using Ubuntu 8.10 Server.

How to backup database? I don't want to do it by phpmyadmin. Is there any command to export it fast? Also is there any way to export it every day at the same time?
 
Hello,
I'm using Ubuntu 8.10 Server.

How to backup database? I don't want to do it by phpmyadmin. Is there any command to export it fast? Also is there any way to export it every day at the same time?

make a file named backup.sh
and paste in
Code:
#!/bin/bash
/usr/bin/mysqldump -u user -ppass --databases DB_NAME | gzip > /DIRECTORY/2/SAVE/IN/NAME_`date +%m_%d_%y`.gz

PHP:
user . usually root
pass . your password
DB_NAME . database name
/DIRECTORY/..  directory to save in

so for example

#!/bin/bash
/usr/bin/mysqldump -u root -pmypass --databases goosioot | gzip > /home/goose/Desktop/2GoosioOT_`date +%m_%d_%y`.gz

that will put the database in a compressed file..to do it on a regular basis automatically you need to create a cron task, google it, you will find some info on it
 
Back
Top