https://github.com/CreativeCodeCat/xfs-snapshots
XFS Backup and Restore Script
https://github.com/CreativeCodeCat/xfs-snapshots
Last synced: 15 days ago
JSON representation
XFS Backup and Restore Script
- Host: GitHub
- URL: https://github.com/CreativeCodeCat/xfs-snapshots
- Owner: CreativeCodeCat
- Created: 2023-06-29T13:22:49.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-28T14:35:50.000Z (over 1 year ago)
- Last Synced: 2025-05-03T22:57:16.943Z (19 days ago)
- Language: Shell
- Homepage:
- Size: 14.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# XFS Backup and Restore Script
This script provides a menu-based interface to perform XFS backup, restore, and removal operations. It allows users to create backups of XFS file systems using xfsdump, compress them with gzip, restore backups using xfsrestore, and remove existing backups. The script presents a menu with options to perform these operations and guides the user through the process. It also manages the maximum number of backups by automatically removing the oldest backup if the limit is exceeded.
## Dependencies
The following dependencies are required to run the script:
- xfsdump (xfsprogs) - For XFS backup and restore utilities
- gzip - For compressing backup files
- coreutils - For command-line utilities like ls and rm## Usage
1. Make sure you have the required dependencies installed on your system.
2. Clone the repository or download the script file.
3. Set the necessary variables in a config file:```shell
max_backups=10
backup_directory="/mnt/500GB/example"
xfs_device="/dev/sdb1"
target_directory="/mnt/500GB/example2"
```4. Install the script:
```shell
sudo make install
```5. Run the script:
```shell
xfs-snapshots
```6. The script will present a menu with the following options:
- **Backup XFS**: Perform an XFS backup.
- **List Backups**: Display a list of available backups.
- **Remove Backup**: Remove a backup from the backup directory.
- **Exit**: Exit the script.7. Follow the instructions provided by the script to perform the desired operation.
## Color Codes
In the provided script, the color codes are used for formatting the output on the terminal. Here's the meaning of each color code used:
- `RED`: Indicates red color for error or warning messages.
- `GREEN`: Indicates green color for success or informative messages.
- `YELLOW`: Indicates yellow color for highlighting or cautionary messages.
- `BLUE`: Indicates blue color for section headers or titles.
- `NC` (No Color): Resets the text color to the default color.These color codes are used to enhance the readability and visual presentation of the script's output. For example, error messages can be displayed in red to draw attention, success messages can be displayed in green to indicate successful operations, and so on.
By using these color codes, the script can provide a visually appealing and informative interface for the users to interact with.
## License
This script is released under the [MIT License](LICENSE).
## Author
- Name: The-Repo-Club
- Email: [email protected]
- GitHub: [The-Repo-Club](https://github.com/The-Repo-Club/)