You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[Generating random keys](#generating-random-keys)
55
-
*[Scheduled backups (please note this is work in progress for version 0\.9\.0)](#scheduled-backups-please-note-this-is-work-in-progress-for-version-090)
The `schedule` can be a string or an array of string (to allow for multiple schedules)
682
682
683
-
Here's an example of a YAML configuration for Windows:
683
+
Here's an example of a YAML configuration:
684
684
685
685
```yaml
686
686
default:
@@ -696,8 +696,7 @@ self:
696
696
- "Sat,Sun 0,12:00"# twice a day on week-ends
697
697
schedule-permission: user
698
698
retention:
699
-
schedule:
700
-
- "sun 3:30"
699
+
schedule: "sun 3:30"
701
700
schedule-permission: user
702
701
```
703
702
@@ -708,13 +707,13 @@ resticprofile accepts these internal commands:
708
707
- unschedule
709
708
- status
710
709
711
-
Please note the display of the status command will be OS dependant.
712
-
713
-
If you create a task with `user` permission under Windows, you will need to enter your password to validate the task. It's a requirement of the task scheduler. I'm inviting you to review the code to make sure I'm not emailing your password to myself. Seriously you shouldn't trust anyone.
710
+
Please note the display of the `status` command will be OS dependant.
714
711
715
712
#### Examples of scheduling commands under Windows
716
713
717
-
Example of the schedule command under Windows (with git bash):
714
+
If you create a task with `user` permission under Windows, you will need to enter your password to validate the task. It's a requirement of the task scheduler. I'm inviting you to review the code to make sure I'm not emailing your password to myself. Seriously you shouldn't trust anyone.
715
+
716
+
Example of the `schedule` command under Windows (with git bash):
By default, a macOS agent access is restricted. If you leave it to start in the background it's likely to fail.
885
-
You have to start it manually the first time to accept the requests for access:
886
-
887
-
% launchctl start local.resticprofile.self.backup
888
-
889
-
Do you want to start it now? (Y/n):
890
-
2020/07/28 22:57:26 scheduled job self/backup created
891
-
```
892
-
893
-
Right after you started the profile, you should get some popup asking you to grant access to various thing. If you backup your files to an external repository on a network you will get this request:
894
-
895
-

896
-
897
-
898
866
The `status` command shows a combination of `journalctl` displaying errors (only) in the last month and `systemctl status`:
899
867
900
868
```
@@ -942,7 +910,7 @@ Jul 28 15:10:07 Desktop76 systemd[2951]: Started check timer for profile test1 i
macOS has a very tight protection system when running scheduled tasks (also called agents).
926
+
927
+
Under macOS, resticprofile is asking if you want to start a profile right now so you can give the access needed to the task (it will consist on a few popup windows)
928
+
929
+
Here's an example of scheduling a backup to Azure (which needs network access):
By default, a macOS agent access is restricted. If you leave it to start in the background it's likely to fail.
944
+
You have to start it manually the first time to accept the requests for access:
945
+
946
+
% launchctl start local.resticprofile.self.backup
947
+
948
+
Do you want to start it now? (Y/n):
949
+
2020/07/28 22:57:26 scheduled job self/backup created
950
+
```
951
+
952
+
Right after you started the profile, you should get some popup asking you to grant access to various files/folders/network.
953
+
954
+
If you backup your files to an external repository on a network, you should get this popup window:
955
+
956
+

957
+
958
+
955
959
### Changing schedule-permission from user to system, or system to user
956
960
957
961
If you need to change the permission of a schedule, **please be sure to `unschedule` the profile before**.
@@ -1245,7 +1249,7 @@ stdin:
1245
1249
```
1246
1250
1247
1251
Also here's an example of a configuration file in HCL:
1248
-
```hcl
1252
+
```hcl
1249
1253
global {
1250
1254
priority = "low"
1251
1255
ionice = true
@@ -1370,21 +1374,32 @@ When you schedule a profile with the `schedule` command, under the hood resticpr
1370
1374
- run `systemctl enable`
1371
1375
- run `systemctl start`
1372
1376
1373
-
**Please note the first time you schedule a profile, the `systemctl start` command will trigger a immediate start of the profile. It usually means if you have a backup and a check, it will start both straight away. So far I haven't found a way of preventing it.**
1374
1377
1375
1378
## Using resticprofile and launchd on macOS
1376
1379
1377
1380
`launchd` is the service manager on macOS. resticprofile can schedule a profile via a _user agent_ or a _daemon_ in launchd.
1378
1381
1379
1382
### User agent
1380
1383
1381
-
A user agent is generated when you set `schedule-permission` to `user`.
1384
+
A user agent is generated when you set `schedule-permission` to `user`.
1382
1385
1383
1386
It consists of a `plist` file in the folder `~/Library/LaunchAgents`:
1384
1387
1385
-
A user agent **mostly** runs with the privileges of the user. But if you backup some specific files, like your contacts or your calendar for example, you will need to give more permissions to resticprofile **and** restic
1388
+
A user agent **mostly** runs with the privileges of the user. But if you backup some specific files, like your contacts or your calendar for example, you will need to give more permissions to resticprofile **and** restic.
1389
+
1390
+
For this to happen, you need to start the agent or daemon from a console window first (resticprofile will ask if you want to do so)
1391
+
1392
+
If your profile is a backup profile called `remote`, the command to run manually is:
0 commit comments