From 2a8341080381ab591385f7a639a19797307d0534 Mon Sep 17 00:00:00 2001 From: "Jeremy D. Berkleef" Date: Thu, 6 May 2021 22:34:54 -0300 Subject: [PATCH] Change dirs for tar --- bookstack-backup.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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