Skip to content

Commit ef83fe3

Browse files
authored
docs: clarify systemd unit placement and sudo requirements per permission (#613)
Explain which systemd unit location is used for each schedule-permission value, and make it clear that `user` still requires sudo while `user_logged_on` does not. Add a tip pointing users toward lingering as the path to rootless always-on scheduling.
1 parent e03d9cd commit ef83fe3

2 files changed

Lines changed: 21 additions & 9 deletions

File tree

docs/content/schedules/configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ profile:
7575

7676
* `system`: Access system or protected files. Run resticprofile with `sudo` on Unix and with elevated prompt on Windows. On Windows, resticprofile will automatically request elevated permissions if needed.
7777

78-
* `user`: Run the backup using current user permissions. Suitable for saving documents or files within your profile. **This mode runs even when the user is not logged on**. It will ask for your user password on Windows. It needs root permission (via sudo) when using `systemd`.
78+
* `user`: Run the backup using current user permissions. Suitable for saving documents or files within your profile. **This mode runs even when the user is not logged on**. It will ask for your user password on Windows. On Linux with `systemd`, this creates a system unit with `User=` set — it requires root permission (via sudo) to schedule, but the backup itself runs as the unprivileged user. If you want to schedule without sudo, use `user_logged_on` with [lingering](https://wiki.archlinux.org/title/Systemd/User#Automatic_start-up_of_systemd_user_instances) enabled instead.
7979

80-
* `user_logged_on`: **Not for crond** - Provides the same permissions as `user`, but runs only when the user is logged on. On Windows, it does not ask for your user password.
80+
* `user_logged_on`: **Not for crond** - Provides the same permissions as `user`, but runs only when the user is logged on (unless [lingering](https://wiki.archlinux.org/title/Systemd/User#Automatic_start-up_of_systemd_user_instances) is enabled). On Linux with `systemd`, this creates a unit in the user's systemd profile (`~/.config/systemd/user/`) and does **not** require sudo to schedule. On Windows, it does not ask for your user password.
8181

8282
* *empty*: resticprofile will guess based on how it was started (with sudo or as a normal user). The fallback is `system` on Windows and `user_logged_on` on other platforms.
8383

docs/content/schedules/systemd.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ weight: 105
66

77
**systemd** is a common service manager used by many Linux distributions. resticprofile can create systemd timer and service files.
88

9-
User systemd units are created under the user's systemd profile (`~/.config/systemd/user`).
9+
The type of unit created depends on the `schedule-permission` setting:
1010

11-
System units are created in `/etc/systemd/system`.
11+
| Permission | Unit location |
12+
|--------------------|-------------------------------|
13+
| `system` | `/etc/systemd/system/` |
14+
| `user` | `/etc/systemd/system/` (with `User=` field set) |
15+
| `user_logged_on` | `~/.config/systemd/user/` |
1216

1317
## systemd calendars
1418

@@ -57,11 +61,19 @@ Until version v0.30.0, the `user` permission was actually `user_logged_on` unles
5761

5862
This is now fixed:
5963

60-
| Permission | Type of unit | Without lingering | With lingering |
61-
|--------------------|-------------------------------------------|----------------------------------|---------------------|
62-
| **system** | system service | can run any time | can run any time |
63-
| **user** | system service with User= field defined | can run any time | can run any time |
64-
| **user_logged_on** | user service | runs only when user is logged on | can run any time |
64+
| Permission | Type of unit | Without lingering | With lingering | Requires sudo to schedule |
65+
|--------------------|-------------------------------------------|----------------------------------|---------------------|---------------------------|
66+
| **system** | system service | can run any time | can run any time | yes |
67+
| **user** | system service with User= field defined | can run any time | can run any time | yes |
68+
| **user_logged_on** | user service | runs only when user is logged on | can run any time | no |
69+
70+
{{% notice tip %}}
71+
If you want to run backups as a regular user without root privileges at scheduling time, use `permission: user_logged_on`. To allow the schedule to run even when the user is not logged in, enable [lingering](https://wiki.archlinux.org/title/Systemd/User#Automatic_start-up_of_systemd_user_instances) for your user:
72+
73+
```shell
74+
loginctl enable-linger $USER
75+
```
76+
{{% /notice %}}
6577

6678

6779

0 commit comments

Comments
 (0)