Simple backup cli tool written with Go
This document provides details about the available flags for the File Trove CLI tool, their descriptions, and example usages.
Flag | Type | Default | Description |
---|---|---|---|
--operation |
String | "backup" |
Specifies the operation type. Allowed values: backup , restore . |
--src |
String | "" (required) |
Path to the source directory for the operation. |
--dest |
String | "" (required) |
Path to the destination directory for the operation. |
--period |
Int | 0 |
Sets the backup interval in minutes. If 0 , the backup runs once. |
--compress |
Bool | false |
Enables compression of the backup into a ZIP file. |
--detach |
Bool | false |
Runs the tool in detached mode (background) and logs to a specified file. |
--log |
String | "file-trove.log" |
Specifies the log file path. |
--exclude |
String | "" |
Comma-separated list of files/directories to exclude from the operation. |
This section provides examples of how to use the File Trove CLI tool with different flags and configurations.
Compile the tool to generate the executable:
git clone https://github.com/pooulad/file-trove.git
cd file-trove
go build -o file-trove.exe . // in windows os
or
go build -o file-trove .
Perform a simple backup from the source directory to the destination directory:
Windows example:
.\file-trove --operation backup --src "C:\Users\YourName\Documents" --dest "D:\Backups"
Linux example:
./file-trove --operation backup --src "src/folder" --dest "dest/folder"
Perform a backup every 10 minutes:
Windows example:
.\file-trove --operation backup --src "C:\Projects" --dest "E:\ProjectBackups" --period 10
Linux example:
./file-trove --operation backup --src "src/folder" --dest "dest/folder" --period 10
Perform a periodic backup every 15 minutes, compress the result, exclude unnecessary files, and log to a file:
Windows example:
.\file-trove --operation backup --src "C:\Source" --dest "D:\Destination" --period 15 --compress --log "backup.log" --exclude "temp,cache"
Linux example:
./file-trove --operation backup --src "src/folder" --dest "dest/folder" --period 15 --compress --log "backup.log" --exclude "temp,cache"
Checkout example
directory for see result of tool.
This section tracks the progress of implemented features in the File Trove CLI tool.
- Implement
--period
flag to allow periodic backups. - Implement
--compress
flag to enable compression of backups into a ZIP file. - Implement
--detach
flag to run the backup operation in detached mode with logging to a file. - Implement
--log
flag to define the log file path. - Implement
--exclude
flag to skip specific files or directories during backup.
If you find this project useful or interesting, please consider giving it a ⭐️ on GitHub! It means a lot and helps others discover this project. Your support keeps the project alive and evolving!
- Go to the GitHub repository.
- Click on the ⭐️ button at the top-right corner.
🌟 Show Your Support: Your star demonstrates appreciation for the effort behind the project.
🌟 Spread the Word: Stars make the project more visible to others on GitHub.
🌟 Stay Updated: Starring makes it easy to track updates in your list of starred repositories.
Thank you for taking the time to explore and support this project! 🚀