Skip to content

Commit f3da182

Browse files
docs: update example of scheduling on macOS
1 parent f14094b commit f3da182

1 file changed

Lines changed: 66 additions & 24 deletions

File tree

docs/content/schedules/examples.md

Lines changed: 66 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -319,42 +319,84 @@ Removed /home/user/.config/systemd/user/timers.target.wants/resticprofile-check@
319319
320320
### Examples of scheduling commands under macOS
321321
322-
macOS has a very tight protection system when running scheduled tasks (also called agents).
322+
Here's an example of scheduling a backup profile named `azure-dev`:
323323
324-
Under macOS, resticprofile is asking if you want to start a profile right now so you can give the access needed to the task, which consists on a few popup windows (you can disable this behavior by adding the flag `--no-start` after the schedule command).
324+
```shell
325+
% resticprofile -n azure-dev schedule
326+
2025/03/30 18:40:13 using configuration file: profiles.yaml
325327
326-
Here's an example of scheduling a backup to Azure (which needs network access):
328+
Profile (or Group) azure-dev: backup schedule
329+
=============================================
330+
Original form: 22:22
331+
Normalized form: *-*-* 22:22:00
332+
Next elapse: Sun Mar 30 22:22:00 BST 2025
333+
(in UTC): Sun Mar 30 21:22:00 UTC 2025
334+
From now: 3h41m46s left
327335
328-
```shell
329-
% resticprofile -v -c examples/private/azure.yaml -n self schedule
336+
2025/03/30 18:40:13 scheduled job azure-dev/backup created
330337
331-
Analyzing backup schedule 1/1
332-
=================================
333-
Original form: *:0,15,30,45:00
334-
Normalized form: *-*-* *:00,15,30,45:00
335-
Next elapse: Tue Jul 28 23:00:00 BST 2020
336-
(in UTC): Tue Jul 28 22:00:00 UTC 2020
337-
From now: 2m34s left
338+
```
338339
340+
In some cases, macOS may request permission to access the network, an external volume (like a USB drive), or a protected directory. A message will appear while the backup runs in the background.
339341
340-
By default, a macOS agent access is restricted. If you leave it to start in the background it's likely to fail.
341-
You have to start it manually the first time to accept the requests for access:
342+
To respond immediately, start the task now:
342343
343-
% launchctl start local.resticprofile.self.backup
344+
1. Retrieve the task name using the status command:
344345
345-
Do you want to start it now? (Y/n):
346-
2020/07/28 22:57:26 scheduled job self/backup created
346+
```shell
347+
% resticprofile -n azure-dev status
348+
2025/03/30 18:40:21 using configuration file: profiles.yaml
349+
350+
Profile (or Group) azure-dev: backup schedule
351+
=============================================
352+
Original form: *-*-* 22:22:00
353+
Normalized form: *-*-* 22:22:00
354+
Next elapse: Sun Mar 30 22:22:00 BST 2025
355+
(in UTC): Sun Mar 30 21:22:00 UTC 2025
356+
From now: 3h41m38s left
357+
358+
service: local.resticprofile.azure-dev.backup
359+
permission: user
360+
program: /usr/local/bin/resticprofile
361+
working directory: /Users/cp/resticprofile
362+
stdout path: local.resticprofile.azure-dev.backup.log
363+
stderr path: local.resticprofile.azure-dev.backup.log
364+
state: not running
365+
runs (*): 0
366+
last exit code (*): (never exited)
367+
* : since last (re)schedule or last reboot
347368
```
348369
349-
Right after you started the profile, you should get some popup asking you to grant access to various files/folders/network.
370+
The name of the task can be seen on the line `service: ...`
350371
351-
If you backup your files to an external repository on a network, you should get this popup window:
372+
2. start the task manually
352373
353-
!["resticprofile" would like to access files on a network volume](https://github.com/creativeprojects/resticprofile/raw/master/network_volume.png)
374+
```shell
375+
% launchctl start local.resticprofile.azure-dev.backup
376+
```
354377
355-
**Note:**
356-
If you prefer not being asked, you can add the `--no-start` flag like so:
378+
You can check the task is currently running:
357379
358380
```shell
359-
resticprofile -v -c examples/private/azure.yaml -n self schedule --no-start
360-
```
381+
2025/03/30 18:42:07 using configuration file: profiles.yaml
382+
383+
Profile (or Group) azure-dev: backup schedule
384+
=============================================
385+
Original form: *-*-* 22:22:00
386+
Normalized form: *-*-* 22:22:00
387+
Next elapse: Sun Mar 30 22:22:00 BST 2025
388+
(in UTC): Sun Mar 30 21:22:00 UTC 2025
389+
From now: 3h39m52s left
390+
391+
service: local.resticprofile.azure-dev.backup
392+
permission: user
393+
program: /usr/local/bin/resticprofile
394+
working directory: /Users/cp/resticprofile
395+
stdout path: local.resticprofile.azure-dev.backup.log
396+
stderr path: local.resticprofile.azure-dev.backup.log
397+
state: running
398+
runs (*): 1
399+
last exit code (*): (never exited)
400+
* : since last (re)schedule or last reboot
401+
402+
```

0 commit comments

Comments
 (0)