Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ismail-mouyahada/script-backup-bash-windows
🎉 Exciting Release! Introducing version 1.0 of our Windows Backup Script, a simple Bash script designed to automate and streamline backups on Windows systems.
https://github.com/ismail-mouyahada/script-backup-bash-windows
backup script windows
Last synced: 3 days ago
JSON representation
🎉 Exciting Release! Introducing version 1.0 of our Windows Backup Script, a simple Bash script designed to automate and streamline backups on Windows systems.
- Host: GitHub
- URL: https://github.com/ismail-mouyahada/script-backup-bash-windows
- Owner: Ismail-Mouyahada
- Created: 2021-10-22T21:45:55.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-26T23:01:52.000Z (about 1 year ago)
- Last Synced: 2023-12-27T23:58:45.060Z (about 1 year ago)
- Topics: backup, script, windows
- Language: Shell
- Homepage:
- Size: 1.95 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Shell Script for Website Backup
## Overview:
This script automates the backup process for a website, including its MySQL database. It creates a compressed tar archive containing virtual host configurations, website files, and a MySQL database dump.## Variables:
- `today`: Holds the current date in "YYYY-MM-DD" format.
- `destination_backup`: Specifies the destination folder for backups, assumed to be named "backup".
- `vhost_path`: Indicates the path to Apache virtual host configuration files.
- `source $1`: Sources a file specified as a command-line argument, likely containing specific configurations or variables.## Database Export:
```bash
mysqldump -u $db_login -p$db_pwd $db_name > dbbackupfile
```Certainly! If you were explaining this script on GitHub, you might provide a user-friendly description like this:
bash
# Shell Script for Website Backup
## Overview:
This script automates the backup process for a website, including its MySQL database. It creates a compressed tar archive containing virtual host configurations, website files, and a MySQL database dump.## Variables:
- `today`: Holds the current date in "YYYY-MM-DD" format.
- `destination_backup`: Specifies the destination folder for backups, assumed to be named "backup".
- `vhost_path`: Indicates the path to Apache virtual host configuration files.
- `source $1`: Sources a file specified as a command-line argument, likely containing specific configurations or variables.## Database Export:
```bash
mysqldump -u $db_login -p$db_pwd $db_name > dbbackupfile
```Exports the MySQL database specified by $db_login, $db_pwd, and $db_name to a file named "dbbackupfile".
Create Archive:```bash
tar -czf $backup_file $vhost $website_files dbbackupfile
```Creates a compressed tar archive named by $backup_file. Includes virtual host configurations, website files, and the exported database file.
Clean Database Export:```bash
rm dbbackupfile
```
Removes the temporary database backup file.Note: The comment at the end, # for back up in windows, appears incomplete and may be a note about backup compatibility with Windows.
Please ensure variable names are used with the correct syntax in the tar command (e.g., $backup_file, $vhost, $website_files), and update mysqldump to use the correct syntax for the password (-p$db_pwd).