Change some variables
This commit is contained in:
parent
8eac267554
commit
7bd1697213
@ -2,12 +2,16 @@
|
|||||||
|
|
||||||
date=$(date +"%d-%m-%Y@%H-%M")
|
date=$(date +"%d-%m-%Y@%H-%M")
|
||||||
|
|
||||||
# Add your backup path here
|
# Settings
|
||||||
backuppath=/backups/BookStack/
|
backup_path=/backups/BookStack/
|
||||||
cd $backuppath
|
rclone_backup_path=systems-sharepoint:Systems/Backups/BookStack/
|
||||||
|
mysql_user=root
|
||||||
|
mysql_pass=YOURPASSWORDHERE
|
||||||
|
|
||||||
|
cd $backup_path
|
||||||
|
|
||||||
# Dump the MariaDB database
|
# 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
|
# Compress the SQL dump and the BookStack files
|
||||||
tar cvf bookstack_backup_$date.tar.gz bookstack_backup.sql /var/www/BookStack
|
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
|
rm -rf bookstack_db.sql
|
||||||
|
|
||||||
# Delete backups older than 7 days
|
# 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
|
# Add your desired rclone options below
|
||||||
rclone sync $backuppath systems-sharepoint:Systems/Backups/BookStack/
|
rclone sync $backup_path $rclone_backup_path
|
Loading…
Reference in New Issue
Block a user