"
    • You MUST read  Myiptvforum Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.
    • The ONLY language allowed in this forum is ENGLISH and it should be used in ALL POSTS.

    • If you use a proxy server or a VPN for registration or login, your account could be directly banned. The reason is that you may register or login via an IP address that was used by a Members which was banned in the past. The same applies if different users use one device (PC, laptop, smartphone), this will also leads to a ban!
    • If you are banned for using a VPN Contact us by open ticket
    • All new Registrations will be manually approved Please do not use VPN or you will automatically get banned!
Resource icon
xF2 Add-on
< Previous | Next >
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
[/B] Bash: ############################################################################ 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 # board active switch turns to off /bin/env php $public_doc_dir/cmd.php xf:board-active off -m "Sorry for the inconvenience but we're performing some maintenance at the moment. we'll be back online shortly!" mysqldump --opt --default-character-set=utf8mb4 -u$dbuser -p$dbpass $dbname > db$(date +"%d-%m-%Y").sql .... ... .. # Board active switch turns to on and message sets back to the default /bin/env php $public_doc_dir/cmd.php xf:board-active off -m "Sorry, we're currently unavailable. Please check back later.." [B]


example usage:
php cmd.php xf:board-active on -m "Sorry, we're currently unavailable. Please check back later.."

Similar resources

0.00 star(s) 0 ratings
Downloads
0
Updated
Top