autorestic
autorestic copied to clipboard
Build for Windows
Hi there! I noticed restic
has a Windows binary but autorestic
doesn't, so I thought I'd modify the build script to build Windows (32 and 64-bit) binaries. Here are some things I changed:
- Add Windows (32 and 64-bit) to build targets
- File names of Windows binaries has the required
exe
extension - Use zip compression for Windows, as Windows systems can't decompress bzip2 archives without 3rd-party programs. Code is heavily inspired by restic's build script :)
- Configure the GitHub Actions workflow to only release
bzip2
andzip
files.
Releases are still created the same way with the Actions workflow, and now include Windows binaries.
Edit: I did some basic testing (local backup/restore a test directory) on my Windows machine (running Windows 10 20H2, 64bit) and it seems to work well.
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/cupcakearmy/autorestic/F3PL2GemunCGxGXfTFhTe8qUJZz9
✅ Preview: https://autorestic-git-fork-chrisx8-master-cupcakearmy.vercel.app
Thank you very much! I'll need to test some stuff out, like all the path stuff https://github.com/cupcakearmy/autorestic/blob/c9f425ef643f7bc363a890482f41639a83eb1430/internal/bins/bins.go#L21 but would be great to have support for that.
Also the install script would need some love.
Local backup seems to work fine. In the config file (.autorestic.yml
), just specify paths like one usually do on Windows (like D:\backup\restic1
) would work. I haven't tested any remote backup targets though.
The self-upgrade function probably would be broken in many ways. I'll take a look when I have some more time.
If you want you can work on it, otherwise I can do that too, but not before tuesday as I have quite some stuff to do :)
Hi,
Thanks for your hard work, is there any ETA for when this become avaliable officially?
Hi,
Thanks for your hard work, is there any ETA for when this become avaliable officially?
I don't have much time to mantain another OS unfortunately :/ So at least for now no official meta. But you could use the docker image.
This looks very promising! I glanced at the changed files and there's little change to autorestic itself. Could we summarize a list of potentially broken functions in Windows?
As far as I know, everything except install
and upgrade
should be working just fine. Seems like install
and upgrade
assume a UNIX-like environment.
Edit: @cqjjjzr, I have compiled Windows binaries available in my fork. Feel free to try it out and tell us what you find!
As far as I know, everything except
install
andupgrade
should be working just fine. Seems likeinstall
andupgrade
assume a UNIX-like environment.Edit: @cqjjjzr, I have compiled Windows binaries available in my fork. Feel free to try it out and tell us what you find!
it seems to be working fine so far haven't noticed any bugs
@ArabCoders @chrisx8 Super cool, would give it a try once my backends are ready!
Nice that a lot of people are interessed! About https://github.com/cupcakearmy/autorestic/pull/68/files#diff-7fdd319c657fbde54b83a5dfa233c5c2c417b291739ff75c05dc5d83ee7a9d24R68 : is zip preinstalled on windows?
Also we would need to figure out upgrade and install scripts
is zip preinstalled on windows
Not really. However, we have tar.exe
and Compress-Archive
Powershell cmdlet. How about these?
One more question, I'm planning to test out if Ctrl+C works normally on Windows. Ideally, it should send SIGINT to the underlying restic process so it can clean up and exit gracefully, so I need to do some tests.
More Information: https://docs.microsoft.com/en-us/windows/console/ctrl-c-and-ctrl-break-signals
is zip preinstalled on windows?
Windows File Explorer can open and create zip archives. There's also Expand-Archive
in PowerShell. Both options are built in to Windows, which is why I packaged Windows releases as zip.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated |
---|---|---|---|
autorestic | ✅ Ready (Inspect) | Visit Preview | May 3, 2022 at 2:09AM (UTC) |
@cupcakearmy any chance of getting this merged into main build?
Hi, I'd love to see this get merged as well!
Still no windows build?
Hooks probably need a little work to support Windows as the default shell and its flags should be probably at least manually configurable via config, if not auto detected. That change should benefit other OS' as well.