How asrendon/simple-backup works
Main Components
• Backup Configuration Editor – the GUI applications are delivered as platform‐specific JARs (e.g., LinuxEditor.jar, MacEditor.jar, WindowsEditor.jar). Their role is to let the user define the backup “sources” and “destination” and then generate (or update) the backup_config.json file.
• Configuration File – the JSON file is a central element that stores user-defined directories for sources and backups.
• Backup Execution Scripts – OS-level scripts are provided:
○ Windows: simple_backup_win.ps1, which reads the JSON config and iterates through RoboCopy commands.
○ Mac/Linux: simple_backup_nix.py (although “coming soon” is mentioned for the Mac/Linux UI instructions, the script exists and implements the rsync command).
• Core Java Backup Application – contained under the SimpleBackup directory (with App.java, SuperMain.java, module-info.java, and Maven configuration files). This code represents the backup functionality that may be used in some packaging or integrated features. Even if it is not fully polished as a runnable JAR, it forms a logical part of the system.
• External Tools – note that the backup process leverages external file replication utilities (RoboCopy for Windows and rsync for Mac/Linux).
Relationships and Interactions
• The Backup Configuration Editor (running as a JAR) creates or updates the backup_config.json file.
• The backup_config.json file is then used by the backup scripts. For example, when a Windows user runs the PowerShell script, it loads the JSON config to determine which “source” directories should be replicated to the “destination.”
• Platform-specific execution: depending on the OS, the appropriate script (PowerShell vs. Python) interprets the config and triggers system-level file copy/replication commands.
• The core Java application (packaged under the SimpleBackup directory) may also be responsible for some backup functions or could be evolved in the future to integrate more logic that might eventually replace or complement the scripts.
Architectural Patterns and Technologies
• Modularity: There is a clear separation between configuration (UI to generate config files) and execution (scripts that act based on the config).
• Platform Abstraction: The design handles OS-specific behavior using different editor JARs and backup scripts, yet ties them together with a common JSON configuration file.
• Use of External Tools: The system leverages native backup commands (RoboCopy and rsync), which are external dependencies for file replication.
• Build and Packaging: The Maven project (SimpleBackup folder) confirms adherence to standard Java modular practices and structured builds.
Elements
• Rectangular nodes labeled:
– “Backup Configuration Editor (Windows/Mac/Linux)”
– “JSON Config File (backup_config.json)”
– “Backup Execution Script (PowerShell – simple_backup_win.ps1)” and “Backup Execution Script (Python – simple_backup_nix.py)”
– “External File Replication Utilities: RoboCopy and rsync”
– Flow from the Configuration Editor to the JSON Config File.
– Flow from the JSON Config File to the Backup Execution Scripts (with a note indicating that these scripts trigger file copy commands).
• Labels for data flow: such as “User sets backup sources/destination” (leading to JSON file creation) and “Script reads config and executes replication.”