Jun 24th, 2013, 5:03 AM
very simple solution is can be implemented by using mysqldump and crontab ...
example of backup script, will backup few tables and full db(table6) :
and add to crontab, will run at 23:00 every day :
0 23 * * * /[path_to_script]/[script_name] >/dev/null 2>/dev/null
example of backup script, will backup few tables and full db(table6) :
Code:
#! /bin/bash
sqldump="/usr/bin/mysqldump"
db="formtools"
table1="ft_form_2"
table2="ft_form_12"
table3="ft_form_2_history"
table4="ft_form_12_history"
table5="ft_forms"
table6=""
for i in "$table1" "$table2" "$table3" "$table4" "$table5" "$table6"; do
$sqldump -u [user] -p[password] $db $i > /backup/full_$i.sql
done
and add to crontab, will run at 23:00 every day :
0 23 * * * /[path_to_script]/[script_name] >/dev/null 2>/dev/null