I am dumping my SQL db with the script below. My site isnt used often so the DB is unchanged for days. The only difference is the last line which is the dump date. Each dump is about 400k uncompressed and 107kb as a .sql.gz file. I decide to compress them as a solid archive with 7z and rar. In both cases i get 950kb with 32files. I feel i should get better compression. How?
#!/bin/bash
cd /home/mybackup/mysqldumps
y=$(date +%Y)
m=$(date +%m)
d=$(date +%d)
h=$(date +%H)
mkdir $y
cd $y
mkdir $m
cd $m
mysqldump --all-databases --single-transaction --flush-logs | gzip > "$y $m $d $h.sql.gz"
chmod 400 "$y $m $d $h.sql.gz"