Compare commits
5 Commits
fcbf7e17b5
...
a9efa075cb
| Author | SHA1 | Date | |
|---|---|---|---|
| a9efa075cb | |||
| 6768de2b6f | |||
| a2ee8d1b93 | |||
| 3d5e1f38f1 | |||
| 3eac45f9cc |
2
.gitignore
vendored
2
.gitignore
vendored
@ -260,3 +260,5 @@ paket-files/
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
**/build_outputs
|
||||
|
||||
@ -38,11 +38,11 @@ If the issue is specific to a particular LTO version that you cannot test, pleas
|
||||
3. **Documentation**: Ensure any new methods, classes, or configurations are fully documented.
|
||||
4. **Testing**: Test your changes thoroughly and add relevant tests where possible.
|
||||
|
||||
Thank you for considering contributing, and feel free to reach out if you have questions! Your support helps make MaksIT.LTO.Backup better for everyone.
|
||||
|
||||
## Contact
|
||||
|
||||
If you have any questions or need further assistance, feel free to reach out:
|
||||
|
||||
- **Email**: [maksym.sadovnychyy@gmail.com](mailto:maksym.sadovnychyy@gmail.com)
|
||||
- **Reddit**: [MaksIT.LTO.Backup: A Simplified CLI Tool for Windows LTO Tape Backups](https://www.reddit.com/r/MaksIT/comments/1ghgbx5/maksitltobackup_a_simplified_cli_tool_for_windows/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button)
|
||||
|
||||
Thank you for considering contributing, and feel free to reach out if you have questions! Your support helps make MaksIT.LTO.Backup better for everyone.
|
||||
|
||||
56
README.md
56
README.md
@ -1,15 +1,22 @@
|
||||
# MaksIT.LTO.Backup
|
||||
|
||||
**⚠️ Warning: This program is currently under fine-tuning and some features are still being added. Extensive real-world testing is still in progress. Use it at your own risk.**
|
||||
|
||||
A C# application designed to facilitate backup and restore operations to an LTO tape drive. This application enables seamless management of backups by handling file organization, descriptor creation, and efficient tape handling processes for loading, writing, and restoring data.
|
||||
|
||||
## Features
|
||||
## Version History
|
||||
|
||||
- **Load and Eject Tape**: Safely loads and unloads the tape using `TapeDeviceHandler`.
|
||||
- **Backup Operation**: Allows users to create a descriptor file for organizing file metadata and backs up files to the LTO tape in structured blocks.
|
||||
- **Restore Operation**: Reads data from the tape and restores files to a specified directory, reconstructing original file structure.
|
||||
- **Customizable Block Sizes**: Supports multiple LTO generations, allowing customization of block sizes based on the tape generation (e.g., LTO-6).
|
||||
- **File Descriptor Management**: Metadata is organized for each file, including file paths, sizes, creation, and modification times.
|
||||
- **Zero-Filled End Blocks**: Marks the end of a backup with zero-filled blocks to assist with reading and integrity checks.
|
||||
**v0.0.1 - Initial Release (01/11/2024)**
|
||||
- Initial implementation of backup and restore operations.
|
||||
- Support for loading and ejecting tape.
|
||||
- Basic file descriptor management.
|
||||
- Customizable block sizes for different LTO generations.
|
||||
- File checksum verification during restore
|
||||
|
||||
**v0.0.2 - (03/11/2024)**
|
||||
- Use of Crc32 for restored data checksums
|
||||
- Improved descriptor handling with AESGCM signature and integrity check
|
||||
- Code review, DI, File logger
|
||||
|
||||
## Requirements
|
||||
|
||||
@ -74,11 +81,24 @@ A C# application designed to facilitate backup and restore operations to an LTO
|
||||
|
||||
### Running the Application
|
||||
|
||||
Execute the application by navigating to the project directory and running:
|
||||
```bash
|
||||
dotnet run
|
||||
Execute the application by navigating to the project directory `src\MaksIT.LTO.Backup` and running:
|
||||
|
||||
```powershell
|
||||
dotnet build && dotnet run
|
||||
```
|
||||
|
||||
or use `dotnet_build_script.bat` to generate executables in `src\build_outputs`. From version `v0.0.2` I started to provide already compiled binaries in [Releases](https://github.com/MAKS-IT-COM/maksit-lto-backup/releases). You have to execute `MaksIT.LTO.Backup.exe` with administrative privileges.
|
||||
|
||||
> ⚠️ **Warning**: When the application is started for the first time, a special secret.txt will be generated in the program root folder. This secret is used to sign descriptor and used during restore to decrypt it and perform integrity check. Please keep its copy safe somwhere.
|
||||
> In case if in your scenario `secret.txt` is a seurity risk, then create system environment variable `LTO_BACKUP_SECRET` and use content from `secret.txt` as a value, after you can delete `secret.txt` from the application folder.
|
||||
|
||||
Here is a powershell snippet to create system environment variable:
|
||||
|
||||
```powershel
|
||||
[System.Environment]::SetEnvironmentVariable("LTO_BACKUP_SECRET", "<secret.txt content here>", [System.EnvironmentVariableTarget]::Machine)
|
||||
```
|
||||
|
||||
|
||||
### Application Menu
|
||||
|
||||
Upon running, the following options will be presented:
|
||||
@ -86,18 +106,10 @@ Upon running, the following options will be presented:
|
||||
1. **Load Tape**: Loads the tape into the drive.
|
||||
2. **Backup**: Prompts the user to select a backup task from the configured list and initiates the backup process.
|
||||
3. **Restore**: Restores a previously backed-up directory from the tape.
|
||||
4. **Eject Tape**: Ejects the tape from the drive safely.
|
||||
4. **Eject Tape**: Ejects the tape from the drive.
|
||||
5. **Get device status**: Mostly used for debugging to understand if device is able to write
|
||||
6. **Tape Erase (Short)**:
|
||||
7. **Reload configurations**
|
||||
6. **Exit**: Exits the application.
|
||||
|
||||
|
||||
### Code Overview
|
||||
|
||||
- **Application Class**: Main class handling backup and restore functionalities. Provides methods like `LoadTape`, `EjectTape`, `Backup`, `Restore`, `CreateDescriptor`, `WriteFilesToTape`, and `FindDescriptor`.
|
||||
- **TapeDeviceHandler**: Controls tape device operations such as setting positions, writing data, and reading data.
|
||||
- **BackupDescriptor**: Organizes metadata for backed-up files. Used to log details about each file block on tape.
|
||||
6. **Tape Erase (Short)**: Short tape erase
|
||||
7. **Exit**: Exits the application.
|
||||
|
||||
### Sample Configuration
|
||||
|
||||
@ -149,7 +161,7 @@ Below is an example configuration setup for an LTO-6 tape generation backup oper
|
||||
|
||||
### Error Handling
|
||||
|
||||
Errors during backup or restore are caught and logged to the console. Ensure that your `TapeDeviceHandler` is correctly configured and that the tape drive is accessible.
|
||||
Errors during backup or restore are caught and logged to the console and to `log.txt` in the program root folder.
|
||||
|
||||
## Contact
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
# Define project path
|
||||
$projectPath = "./YourProject.csproj"
|
||||
$projectPath = "./MaksIT.LTO.Backup/MaksIT.LTO.Backup.csproj"
|
||||
|
||||
# List of runtime identifiers for self-contained deployments
|
||||
$runtimes = @(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user