This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # MySQL Backup Installation Script | |
| # Downloads and configures mysqlbackup.sh with AWS credentials and cron job | |
| # Usage: ./install-mysqlbackup.sh | |
| set -euo pipefail | |
| # Color codes for output | |
| RED='\033[0;31m' | |
| GREEN='\033[0;32m' | |
| YELLOW='\033[1;33m' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Usage: mysqlbackup.sh <domain> <dbname> | |
| #cron example: 0 0,5,10,15,20 * * * /path/to/mysqlbackup.sh example.com mydatabase >> /path/to/cron.log 2>&1 | |
| set -euo pipefail | |
| # Validate arguments | |
| if [[ $# -lt 2 ]]; then | |
| echo "Error: Missing required arguments" >&2 | |
| echo "Usage: $0 <domain> <dbname>" >&2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <body> | |
| <style> | |
| h1 {color: red;} | |
| </style> | |
| <h1> Test page from AWS pipeline </h1> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1.Stop mysql | |
| ============ | |
| systemctl stop mysqld | |
| 2.Set the mySQL environment option | |
| =============================== | |
| systemctl set-environment MYSQLD_OPTS="--skip-grant-tables" | |
| 3.Start mysql usig the options you just set | |
| =========================================== |