Resource icon

xF2 Add-on [Earl] Board Active Cli 1.0.0a

No permission to download
Compatible XF Versions
  1. 2.2
This add-on allows you to turn your board on and off with command line interface.

So you can use this option to flip the "Board active" switch when you preparing to make a database backup and flip it back on when done.

You can automate the whole backup process by making a shell script like this and adding it to the crontab


Code:
#!/usr/bin/env bash

############################################################################
#                                                                          #
#                              SET VARS                                    #
#                                                                          #
############################################################################

vhost_path=/home/nginx/domains/yourdomain.com
public_doc_dir=$vhost_path/public
random_string=$(cat /dev/random | tr -dc '0-9' | fold -w 256 | head --bytes 7)
backup_dir=$public_doc_dir/backups/$(date +"%d-%m-%Y")/$random_string
elastic_snapshot_repo=/home/es_repo

dbuser=$(grep username $public_doc_dir/src/config.php | awk -F\' '{ print $6 }')
dbpass=$(grep password $public_doc_dir/src/config.php | awk -F\' '{ print $6 }')
dbname=$(grep dbname $public_doc_dir/src/config.php | awk -F\' '{ print $6 }')

############################################################################
#                                                                          #
#                       BACKUP PROCESS                                     #
#                                                                          #
############################################################################

mkdir -p $backup_dir
/bin/env php $public_doc_dir/cmd.php xf:board-active off
mysqldump --opt --default-character-set=utf8mb4 -u$dbuser -p$dbpass $dbname > db$(date +"%d-%m-%Y").sql
....
...
..


example usage:

Author
Admin
Size
6.1 KB
Extension
zip
Downloads
4
Views
1,078
First release
Last update

More resources from Admin

730Threads
2,282Messages
62,920Members
zbetbingoLatest member
Back