restic-windows-backup
restic-windows-backup copied to clipboard
unable to setup task
Hi All, im not able to create the scheduledtask via the install.ps1, i just keep getting an error?
Register-ScheduledTask : The parameter is incorrect.
At C:\restic\install.ps1:52 char:9
+ Register-ScheduledTask $backup_task_name -Action $task_action
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (PS_ScheduledTask:Root/Mi
dTask], CimException
+ FullyQualifiedErrorId : HRESULT 0x80070057,Register-ScheduledTask
any suggestions?
Can you share your configuration? It would help to know what parameters are being passed to the command to debug.
its just the standard setup with the items set in secret.ps1 like user/pass server etc, changed nothing, will try to get it for you soon, out at mo sorry
Hi @kmwoley, forgive my long delay, im not doing anything special Server 2012 R2, up to date
- downloaded the repo and extracted to
C:\restic - changed the config.ps1
# backup configuration
$ExeName = "restic.exe"
$InstallPath = "C:\restic"
$ResticExe = Join-Path $InstallPath $ExeName
$StateFile = Join-Path $InstallPath "state.xml"
$WindowsExcludeFile = Join-Path $InstallPath "windows.exclude"
$LocalExcludeFile = Join-Path $InstallPath "local.exclude"
$LogPath = Join-Path $InstallPath "logs"
$LogRetentionDays = 30
$InternetTestAttempts = 10
$GlobalRetryAttempts = 4
# maintenance configuration
$SnapshotMaintenanceEnabled = $true
$SnapshotRetentionPolicy = @("--group-by", "host", "--keep-daily", "30", "--keep-weekly", "52", "--keep-monthly", "24", "--keep-yearly", "10")
$SnapshotPrunePolicy = @("--max-unused", "1%")
$SnapshotMaintenanceInterval = 7
$SnapshotMaintenanceDays = 30
$SnapshotDeepMaintenanceDays = 90;
# email configuration
$SendEmailOnSuccess = $false
$SendEmailOnError = $false
# Paths to backup
$BackupSources = @{}
$BackupSources["C:\"] = @(
'MyFiles'
)
#$BackupSources["D:\"] = @(
# 'Software'
#)
- copied secret_template.ps1 to secret.ps1 and edited it
# restic backup repository configuration
$Env:AWS_ACCESS_KEY_ID='MYLONGID'
$Env:AWS_SECRET_ACCESS_KEY='MYLONGKEY'
$Env:RESTIC_REPOSITORY='s3:https://mybackups.server.com/MYBUCKET/MYFOLDER'
$Env:RESTIC_PASSWORD='password'
# email configuration
$PSEmailServer='<SMTP SERVER>'
$ResticEmailConfig=@{UseSsl=$true; Port="587"}
$ResticEmailTo='<DESTINATION EMAIL ADDRESS>'
$ResticEmailFrom='<FROM EMAIL ADDRESS>'
$ResticEmailUsername='<EMAIL LOGIN USERNAME>'
$ResticEmailPassword='<EMAIL PASSWORD>'
- added the
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12toinstall.ps1to allow downloading of the restic.zip - then run powershell as admin, and then
cd C:\resticthen.\install.ps1which generates a success but never actually successed?
PS C:\restic> .\install.ps1
Fatal: create key in repository at s3:https://mybackups.server.com/MYBUCKET/MYFOLDER failed:
repository master key and config already initialized
WARNING: [[Init]] Repository initialization failed. Check errors and resolve.
Register-ScheduledTask : The parameter is incorrect.
At C:\restic\install.ps1:52 char:9
+ Register-ScheduledTask $backup_task_name -Action $task_action ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (PS_ScheduledTask:Root/Microsoft/...S_ScheduledTask) [Register-Schedule
dTask], CimException
+ FullyQualifiedErrorId : HRESULT 0x80070057,Register-ScheduledTask
[[Scheduler]] Backup task scheduled.
PS C:\restic>
Can you tell me what language your computer is localized to? There's another issue posted recently that as me wondering if there's a localization issue with the script. Thanks!
Can you tell me what language your computer is localized to? There's another issue posted recently that as me wondering if there's a localization issue with the script. Thanks!
Just English United Kingdom
Same error for me on 2012R2, different language. No error on Server 2019, maybe a Windows 8(.1) specific issue.
Exporting the task on Server 2019 and importing on 2012R2 works.
@si458 @SLiX69
Hey folks - I've left this issue open hoping for other folks to chime in and see if they've run into the issue, and hopefully found a fix. Did any of you ever find a solution here?
I don't really want to close this issue, but I don't have a way to test or get to the bottom of this issue without additional help debugging from someone who can reproduce the issue.
hi @kmwoley currently im having the same issue
@killmasta93 on my system nothing started, the problem is, the SYSTEM user is not the SYTEM user. Please try to select the right user in task scheduler dialog settings.