Hello
found this command to backup my SQL database:
mysqldump --lock-tables -h [server] -u [username] -p[password] [db_name] > nextcloud-sqlbkp_
date +"%Y%m%d".bak
What value shall I use for “server”? Is this the domain name or name of the webserver configuration file?
Kind regards
//neph
tflidd
December 13, 2016, 1:58pm
2
No, it’s the name of your database server. If it’s on the same machine, you can use localhost or even don’t set this value as this is the default setting.
Soko
December 14, 2016, 7:24am
3
For backing up my database I use this script with cron
#!/bin/bash
ZEIT=`date +%d.%m.%y__%T`
echo ">>> $ZEIT busql START" >> /media/bu/mountbu.log
MONAT=`date +%m`
DATZEIT=`date +%d%H%M`
mkdir -p /media/bu/sql/$MONAT
mysqldump -u root -pPASSWORD nextcloud > /media/bu/sql/$MONAT/$DATZEIT.sql
ZEIT=`date +%d.%m.%y__%T`
echo "<<< $ZEIT busql ENDE" >> /media/bu/mountbu.log