Template scripts for Windows 10 user

hi all,

I’ve started using restic and am in love with it. I’d like to implement scripts so my backups are automated, does the community have any scripts or guides ? a gui would be great but in its absence I’ll settle for a script

-kmwoley (https://github.com/kmwoley/restic-windows-backup) - Tried this script and after following guide couldn’t get restic to backup. That being said I never actually specified my source files (files to be backed up) in this script…

  • I’ve seen relica but can barely find any reviews or any recent (after Jan 2020) mention of it on this sub.

FWIW I use the stuff from kmwoley that you linked to above and it works perfectly fine :wink: If you follow the documentation and make adjustmets if needed it should run.

Other than that restic has built-in VSS support so you can always just wrap it up yourself.

1 Like

I found what I was looking for, the script above doesn’t mention that you need to edit the config.ps1 file.

Could you help me understand how to config the config.ps1 file, specifically the below if I want to back up a:\ , b:\ and c:.

Paths to backup

$BackupSources = @{}
$BackupSources[“C:”] = @(

‘Users’

)

I’m assuming everything else in the config.ps1 can be left as defaults. I’m sure this is a basic question but I’m a total noob hence why I’m asking how to include drive letters in the above backup configuration

I’m not entirely sure as I haven’t used it to back up the root of a drive letter like you seem to want, but I would try making it something like this:

# Paths to backup
$BackupSources = @{}
$BackupSources["D:\"] = @(
    '*'
)

If that doesn’t work, I suggest you simply open an issue in the repository of that software over at GitHub and ask there, as they if anyone should know :slight_smile:

1 Like

Thank you once again for your swift response. The developer hasn’t been active since September. So not really an option. Perhaps I’ll simply schedule one task per drive.

Can you share with me a backup path that you would use ? - you indicated you wouldn’t typically use what I proposed above

That’s not true. I opened https://github.com/kmwoley/restic-windows-backup/issues/23 on the 24th of october, and within the very same day the author replied.

There’s no reason to think that just because they’re not very active in the repository, they won’t reply.

Unfortunately I can’t specify how I wrote the configuration, because it’s on someone else’s computer that I don’t have access to.

But checking the snapshots on the repository server, the path that’s been backed up is C:\Users\The Username, so I guess the configuration looks like:

# Paths to backup
$BackupSources = @{}
$BackupSources["C:\"] = @(
    'Users\The Username'
)

Why not just try it and see? Or as I suggested earlier, open an issue and ask for clarification on how the configuration should look to back up an entire drive.

But please consider if that is what you really want to do, e.g. for C: you probably don’t want to back up all of it. But if it’s a pure data drive like D: then it might make sense :slight_smile:

1 Like

Couldn’t I simply back up the C:/ and drop exclude files everywhere I don’t want to back up ?

Unless of course it’s possible to put multiple folder paths for backing up in the above paths ?

Of course you can. Excluding some irrelevant stuff would be prudent to do if you back up C:. I’m just saying that you may want to instead just back up the few things you DO want backed up.

There’s no point in backing up C:\ and excluding e.g. all but one folder on it, when instead you could just ask restic to back up that single folder (just as a hypothetical example).

It is.

Any update on this thread.

What are you wondering about?

I couldn’t back up my windows 10.
Updated: Finally found the soultion after sending some time on the interent.
Ref:Ultimate Guide: Backup Windows 10 - TechLoris

How did you add the initial backup repository on Windows? I can’t get my PC to initialize a repository with restic? Thanks.

Here is a batch file that is working for me on Windows 10 Pro 64 bit Version 20H2.

Save restic.exe on your Desktop. I use v0.12.0

Create a text file and save to your Desktop as mybackup.cmd

@echo off

net session >nul 2>&1 & if errorlevel 1 echo Failed: Must right click and Run As Administrator & goto end
cd %USERPROFILE%\Desktop

set AWS_ACCESS_KEY_ID=MY_ACCESS_KEY_ID
set AWS_SECRET_ACCESS_KEY=MY_SECRET_ACCESS_KEY
set RESTIC_PASSWORD=ABCDEF123456
set RESTIC_REPOSITORY=d:\myrepo

if not exist d:\myrepo\. mkdir d:\myrepo && restic init

restic backup %USERPROFILE%\Desktop %USERPROFILE%\Documents --use-fs-snapshot  

:end
pause

You must run the batch file as Administrator, to do that right click the batch file and choose Run as administrator.