diff --git a/bookstack-backup.sh b/bookstack-backup.sh index 78997ac..13e4528 100644 --- a/bookstack-backup.sh +++ b/bookstack-backup.sh @@ -2,12 +2,16 @@ date=$(date +"%d-%m-%Y@%H-%M") -# Add your backup path here -backuppath=/backups/BookStack/ -cd $backuppath +# Settings +backup_path=/backups/BookStack/ +rclone_backup_path=systems-sharepoint:Systems/Backups/BookStack/ +mysql_user=root +mysql_pass=YOURPASSWORDHERE + +cd $backup_path # Dump the MariaDB database -mysqldump -u root -p bookstack > bookstack_db.sql +mysqldump -u $mysql_user -p $mysql_pass bookstack > bookstack_db.sql # Compress the SQL dump and the BookStack files tar cvf bookstack_backup_$date.tar.gz bookstack_backup.sql /var/www/BookStack @@ -16,7 +20,7 @@ tar cvf bookstack_backup_$date.tar.gz bookstack_backup.sql /var/www/BookStack rm -rf bookstack_db.sql # Delete backups older than 7 days -find $backuppath -type f -mtime +7 -name '*.gz' -delete +find $backup_path -type f -mtime +7 -name '*.gz' -delete # Add your desired rclone options below -rclone sync $backuppath systems-sharepoint:Systems/Backups/BookStack/ \ No newline at end of file +rclone sync $backup_path $rclone_backup_path \ No newline at end of file