diff --git a/bookstack-backup.sh b/bookstack-backup.sh index 5cb2871..380a79b 100644 --- a/bookstack-backup.sh +++ b/bookstack-backup.sh @@ -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 \ No newline at end of file +rclone sync $backup_path*.tar.gz $rclone_backup_path \ No newline at end of file