Update for log rotation and backups

This commit is contained in:
2024-10-14 12:15:11 -07:00
parent ed9ba0118b
commit bbd2de6792
12 changed files with 68 additions and 99 deletions

13
scripts/mysql-backup.sh Normal file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
user=$1
mysql_db=$2
dt=$(date +%y%m%d-%T)
if [ ! -d /home/$user/_db_backups ]; then
mkdir -p /home/$user/_db_backups
fi
/usr/bin/mysqldump $mysql_db > /home/$user/_db_backups/$mysql_db.$dt.sql"
/usr/bin/find /home/$user/_db_backups/ -type f -mmin +360 -delete"
exit 0