https://github.com/ismail-mouyahada/master-bash-backup-script
Exciting Release! Introducing version 1.0 of our LAMP Backup Script, a simple yet powerful tool to automate and secure your LAMP stack data.
https://github.com/ismail-mouyahada/master-bash-backup-script
backup script
Last synced: 8 months ago
JSON representation
Exciting Release! Introducing version 1.0 of our LAMP Backup Script, a simple yet powerful tool to automate and secure your LAMP stack data.
- Host: GitHub
- URL: https://github.com/ismail-mouyahada/master-bash-backup-script
- Owner: Ismail-Mouyahada
- License: mpl-2.0
- Created: 2021-10-24T16:53:20.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-26T23:13:36.000Z (about 2 years ago)
- Last Synced: 2025-02-23T07:34:06.045Z (11 months ago)
- Topics: backup, script
- Language: Shell
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LAMP Backup Script
Hey there! 👋 This is a simple Bash script that I use to automatically back up my LAMP (Linux, Apache, MySQL, PHP/Python/Perl) stack every 5 hours. It's a handy tool to ensure I don't lose any important website data.
## How to Use
### 1. Clone the Repository
```bash
git clone https://github.com/yourusername/lamp-backup-script.git
cd lamp-backup-script
```
2. Configure the Script
Open the lamp_backup.sh script in your favorite text editor. You'll find some variables at the beginning that you can customize:
```bash
# Variables
backup_dir="/path/to/backup"
vhost_path="/etc/apache2/sites-available"
website_files="/var/www/html"
db_user="your_mysql_user"
db_password="your_mysql_password"
db_name="your_database_name"
```
Update these variables with your specific LAMP setup details.
3. Make the Script Executable
```bash
chmod +x lamp_backup.sh
```
4. Schedule the Script
Open your crontab file:
```bash
crontab -e
```
Add the following line to run the script every 5 hours:
```bash
0 */5 * * * /path/to/lamp_backup.sh
```
Save and exit the crontab file.
Important Notes
Make sure you have the necessary privileges to perform backups.
Confirm that MySQL is configured to allow password-less execution of mysqldump.
Adjust paths and variables in the script according to your specific LAMP setup.
Feedback and Contributions
I'd love to hear your feedback or suggestions! Feel free to open issues or pull requests on GitHub.
Happy coding and secure backups! 🚀