Trace: bacula_script
  • MySQL Bacup Script
#!/bin/bash

BACKUPLOCATION=/var/local/mysqlbackups

mkdir -p $BACKUPLOCATION

# back up all the mysql databases, into individual files so we can later restore
# them separately if needed.
mysql --defaults-extra-file=/root/.my.cnf -B -N -e "show databases" | while read db
do
   BACKUPFILE=$BACKUPLOCATION/$db.sql
   echo "Backing up $db into $BACKUPFILE"
   /usr/bin/mysqldump --defaults-extra-file=/root/.my.cnf $db > $BACKUPFILE
done

.My.cnf

[client]
user=sql_user
password=passwd_sql
protocol=tcp
  • Clean Bacula Log Databases
mysql -u username -p
USE bacula;
TRUNCATE TABLE Log;
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki