This is command line utility to backup (zip) current folder. All the code is 100% generated by Github Copilot Agent. So, this software is double-purpose project:
- to test Github Copilot Agent
- to have a better quick backup tool
archive_name exclusions_file_name.txt primary_backup_folder [secondary_backup_folder]
- reads name of the parent folder. For example, if application was started in c:\temp, the name is "temp". This is archive subfolder name.
- in the primary backup folder (3rd argument), create primary target subfolder matching archive subfolder name unless it is already exists.
- in that primary target subfolder, create archive zip file by adding ".zip" to the archive name (1st argument)
- reads exclusions file (2nd argument). This file contains regular expressions defining files and folder to exclude from the archiving. It can contain lines like ^bin$ and .zip$
- enumerates all folders and files
- exclude all folders and files matching regular expressions from the exclusions file
- for all the remaining folders, repeat recursively
- zip all the remaining (i.e., not excluded) enumerated files and filders into the target zip file
- if 4th argument (secondary target) is provided, and the target folder is available, create there secondary target subfolder (unless already exists) and copy there the zip file from the primary target. This operation shall be wrapped in try-catch, since secondary target might not be connected or available.
Implement QuickBackup application according to the description in readme.md. Ask questions if requirements are not clear. Try not adding any additional nuget packages.
You can use exclusions.txt. you can test the applicaztion with arguments: 0a exclusions.txt f:\QBackup h:\QBackup if you run it in the current folder C:\SRC\QuickBackup it shall create subfolder f:\QBackup\QuickBackup\0a.zip and then copy it to h:\QBackup\QuickBackup\0a.zip Please implement this code and run it
Github Copilot Agent generated all the code from the above text in this readme file and it worked from the first attempt. The code is generated with GPT 4.1 LLM.
Create a file q.cmd like:
C:\Tools\QuickBackup\QuickBackup.exe %1 C:\Tools\QuickBackup\exclusions.txt f:\QBackup h:\QBackup
then type:
q <my_archive_version>
(For some reason I do not use timestamp as an achive version)
- for quick one-off projects and prototypes which do not belong to GIT
- for non-source code data which also does not belong to GIT