Change dirs for tar

This commit is contained in:
Jeremy D. Berkleef 2021-05-06 22:34:54 -03:00
parent b2a4a926a2
commit 2a83410803

View File

@ -9,18 +9,19 @@ mysql_user=root
mysql_pass=YOURPASSWORDHERE
cd $backup_path
mkdir database
# Dump the MariaDB database
mysqldump -u=$mysql_user -p=$mysql_pass bookstackdb > bookstack_db.sql
mysqldump -u=$mysql_user -p=$mysql_pass bookstackdb > $backup_path/database/bookstack_db.sql
# Compress the SQL dump and the BookStack files
tar cvf bookstack_backup_$date.tar.gz bookstack_backup.sql /var/www/BookStack
tar zcvf bookstack_backup_$date.tar.gz $backup_path/database /var/www/BookStack
# Delete temporary .sql
rm -rf bookstack_db.sql
rm -rf $backup_path/database/bookstack_db.sql
# Delete backups older than 7 days
find $backup_path -type f -mtime +7 -name '*.gz' -delete
# Add your desired rclone options below
rclone sync $backup_path $rclone_backup_path
rclone sync $backup_path*.tar.gz $rclone_backup_path