Skip to main content
added 3 characters in body
Source Link
djadk
  • 84
  • 1
  • 3
#!/bin/bash for i in $(mysql -uUser -pPASSWORD DATABASE -e "show tables;"|grep -v Tables_in_);do mysqldump -uUSER -pPASSWORD DATABASE $i > /backup/dir/$i$i".sql;donesql";done tar -cvjfcjf backup_mysql_$"backup_mysql_"$(date +'%Y%m%d')".tar.bz2bz2" /backup/dir/*.sql 
#!/bin/bash for i in $(mysql -uUser -pPASSWORD DATABASE -e "show tables;"|grep -v Tables_in_);do mysqldump -uUSER -pPASSWORD DATABASE $i > /backup/dir/$i.sql;done tar -cvjf backup_mysql_$(date +'%Y%m%d').tar.bz2 /backup/dir/*.sql 
#!/bin/bash for i in $(mysql -uUser -pPASSWORD DATABASE -e "show tables;"|grep -v Tables_in_);do mysqldump -uUSER -pPASSWORD DATABASE $i > /backup/dir/$i".sql";done tar -cjf "backup_mysql_"$(date +'%Y%m%d')".tar.bz2" /backup/dir/*.sql 
fixed formatting
Source Link
dpassage
  • 5.5k
  • 3
  • 28
  • 53

#!/bin/bash

for i in $(mysql -uUser -pPASSWORD DATABASE -e "show tables;"|grep -v Tables_in_);do mysqldump -uUSER -pPASSWORD DATABASE $i > /backup/dir/$i.sql;done

tar -cvjf backup_mysql_$(date +'%Y%m%d').tar.bz2 /backup/dir/*.sql

#!/bin/bash for i in $(mysql -uUser -pPASSWORD DATABASE -e "show tables;"|grep -v Tables_in_);do mysqldump -uUSER -pPASSWORD DATABASE $i > /backup/dir/$i.sql;done tar -cvjf backup_mysql_$(date +'%Y%m%d').tar.bz2 /backup/dir/*.sql 

#!/bin/bash

for i in $(mysql -uUser -pPASSWORD DATABASE -e "show tables;"|grep -v Tables_in_);do mysqldump -uUSER -pPASSWORD DATABASE $i > /backup/dir/$i.sql;done

tar -cvjf backup_mysql_$(date +'%Y%m%d').tar.bz2 /backup/dir/*.sql

#!/bin/bash for i in $(mysql -uUser -pPASSWORD DATABASE -e "show tables;"|grep -v Tables_in_);do mysqldump -uUSER -pPASSWORD DATABASE $i > /backup/dir/$i.sql;done tar -cvjf backup_mysql_$(date +'%Y%m%d').tar.bz2 /backup/dir/*.sql 
Source Link
djadk
  • 84
  • 1
  • 3

#!/bin/bash

for i in $(mysql -uUser -pPASSWORD DATABASE -e "show tables;"|grep -v Tables_in_);do mysqldump -uUSER -pPASSWORD DATABASE $i > /backup/dir/$i.sql;done

tar -cvjf backup_mysql_$(date +'%Y%m%d').tar.bz2 /backup/dir/*.sql