general database question
Posted: Fri May 31, 2024 2:23 pm
just a general question is there a way to split the sql backup file php admin only allows 40 mb
Code: Select all
#!/bin/bash
echo 'Backup database...'
BACKUP="/data/backup/daily"
TODAY="$(date '+%Y-%m-%d')";
mkdir -p "$BACKUP/$TODAY"
export MYSQL_PWD=password
# Compact netjukebox database, ignored data will be recreated after update
nice -n +19 mysqldump -uusername --no-data --databases netjukebox > /tmp/netjukebox.sql
nice -n +19 mysqldump -uusername --no-create-info \
--ignore-table=netjukebox.track \
--ignore-table=netjukebox.bitmap \
--ignore-table=netjukebox.country_ipv4 \
--ignore-table=netjukebox.country_ipv6 netjukebox >> /tmp/netjukebox.sql
echo "UPDATE \`server\` SET \`value\` = '0' WHERE \`name\` = 'geolite2_version' LIMIT 1;" >> /tmp/netjukebox.sql
nice -n +19 gzip /tmp/netjukebox.sql; mv -f /tmp/netjukebox.sql.gz "$BACKUP/$TODAY/netjukebox.sql.gz"