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
* optimize systemctl commands
* don't need to call daemon-reload on setting up new files
* update documentation
* fix completion tests
* add tests on reload flag
* Add support for --reload flag in createSchedule and enhance systemd handler
- Implemented the --reload flag in createSchedule to set the reload flag for jobs.
- Updated the systemd handler to manage reload hooks and execute daemon-reload when necessary.
- Improved documentation for keyfile generation and schedule commands for clarity.
* Refactor command flags and enhance systemd handler tests for reload functionality
Copy file name to clipboardExpand all lines: docs/content/schedules/commands.md
+30-31Lines changed: 30 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,20 +3,18 @@ title: "Schedule Commands"
3
3
weight: 20
4
4
---
5
5
6
+
resticprofile supports the following commands:
7
+
-**schedule**
8
+
-**unschedule**
9
+
-**status**
6
10
7
-
resticprofile accepts these commands:
8
-
-**schedule**
9
-
-**unschedule**
10
-
-**status**
11
+
These commands apply to the profile or group specified by `--name`, or to all profiles when `--all` is used.
11
12
12
-
These commands operate on the profile or group selected by `--name`, or on all profiles when `--all` is passed.
13
-
14
-
{{% notice style="warning" %}}
15
-
Before version `0.29.0`, the `--name` flag on a group selected all profiles in the group for scheduling, similar to running the schedule command on each profile individually.
16
-
17
-
Version `0.29.0` introduced group scheduling: The group schedule works at the group level and runs all profiles one by one when triggered.
18
-
{{% /notice %}}
13
+
{{% notice style="warning" %}}
14
+
In versions prior to `0.29.0`, the `--name` flag for a group scheduled all profiles in the group individually, as if the schedule command was run on each profile.
19
15
16
+
Starting with version `0.29.0`, group scheduling was introduced. This feature schedules at the group level, executing all profiles sequentially when triggered.
17
+
{{% /notice %}}
20
18
21
19
Examples:
22
20
```shell
@@ -25,52 +23,53 @@ resticprofile --name group schedule
25
23
resticprofile schedule --all
26
24
```
27
25
28
-
Schedules are always independent, regardless of whether they are created with `--all` or from a single profile.
26
+
Schedules are always independent, whether created with `--all` or a single profile.
29
27
30
28
### schedule command
31
29
32
30
Install all schedules defined in the selected profile(s).
33
31
34
-
Note: On systemd, you need to `start` the timer once to enable it. Otherwise, it will only be enabled on the next reboot. If you don't want to start (and enable) it now, pass the `--no-start` flag to the command.
32
+
**Note:** On systemd, you must `start` the timer once to enable it. Otherwise, it will only activate after the next reboot. To skip starting (and enabling) it now, use the `--no-start` flag.
35
33
36
-
If you use the `--all` flag to schedule all profiles at once, use either `user` mode or `system` mode. Combining both will not schedule tasks properly:
37
-
- If the user is not privileged, only `user` tasks will be scheduled.
38
-
- If the user is privileged, all schedules will be `system` schedules.
34
+
When using the `--all` flag to schedule all profiles at once, choose either `user` mode or `system` mode. Mixing both will cause scheduling issues:
35
+
- Non-privileged users can only schedule `user` tasks.
36
+
- Privileged users will schedule all tasks as `system` tasks.
37
+
38
+
Use the `--reload` flag to trigger a `systemctl daemon-reload` after setting up the schedule files. This is helpful if systemd fails to detect manually added dependencies in the service file. The flag is available starting from version 0.32.0.
39
39
40
40
{{% notice style=tip %}}
41
-
Before version `v0.30.0`, resticprofile did not keep a state of the schedule and unschedule commands. If you needed to make many changes to your profiles (e.g., moving, renaming, deleting), it was recommended to unschedule everything using the `--all` flag before making changes. This is no longer necessary since version `v0.30.0`.
41
+
Before version `v0.30.0`, resticprofile did not track the state of schedule and unschedule commands. If you needed to make significant changes to profiles (e.g., moving, renaming, deleting), it was recommended to unschedule everything using the `--all` flag first. This is no longer required as of version `v0.30.0`.
42
42
{{% /notice %}}
43
43
44
44
### unschedule command
45
45
46
-
Remove all schedules defined on the selected profile, or all profiles using the `--all` flag.
46
+
Remove all schedules from the selected profile or all profiles using the `--all` flag.
47
47
48
-
Before version `v0.30.0`, the `--all` flag didn't remove schedules on deleted or renamed profiles.
48
+
Before `v0.30.0`, the `--all` flag did not remove schedules for deleted or renamed profiles.
49
49
50
-
> [!NOTE]
51
-
> The behavior of the `unschedule` command changed in version `v0.30.0`:
52
-
>
53
-
> It now deletes any schedule associated with the profile name, or any profile in the configuration file with `--all` (including deleted profiles).
50
+
> [!NOTE]
51
+
> Starting with `v0.30.0`, the behavior of the `unschedule` command changed:
52
+
>- Without the `--all` flag, it deletes schedules associated with the profile name.
53
+
> - With the `--all` flag, it removes all profiles from the configuration file, including deleted and renamed ones.
54
54
55
55
### status command
56
56
57
-
Print the status of all installed schedules for the selected profile(s).
57
+
Print the status of all installed schedules for the selected profiles.
58
58
59
-
The `status` command output depends on the OS. Refer to the [examples]({{% relref "/schedules/examples" %}}) for expected output.
59
+
The `status` command output varies by OS. See the [examples]({{% relref "/schedules/examples" %}}) for details.
60
60
61
61
### run-schedule command
62
62
63
+
This command allows the scheduler to instruct resticprofile to run according to a schedule. It configures the appropriate log output (`schedule-log`) and other schedule-specific flags.
63
64
64
-
This command is used by the scheduler to tell resticprofile to execute within a schedule. It sets the proper log output (`schedule-log`) and other schedule-specific flags.
65
-
66
-
If you're scheduling resticprofile manually, use this command. It executes the profile with all `schedule-*` parameters defined in the profile.
65
+
If you're manually scheduling resticprofile, use this command. It runs the profile with all `schedule-*` parameters defined in the profile.
67
66
68
-
This command takes one argument: the command name followed by the profile name, separated by an `@`sign.
67
+
The command requires one argument: the command name followed by the profile name, separated by an `@`symbol.
69
68
70
69
```shell
71
70
resticprofile run-schedule backup@profile
72
71
```
73
72
74
73
{{% notice info %}}
75
-
For the `run-schedule` command, you cannot specify the profile name using the `--name` flag.
76
-
{{% /notice %}}
74
+
The `--name` flag cannot be used to specify the profile name with the `run-schedule` command.
Copy file name to clipboardExpand all lines: docs/content/usage/keyfile.md
+9-10Lines changed: 9 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,24 +5,23 @@ weight: 10
5
5
6
6
## Generating random keys
7
7
8
-
resticprofile has a handy tool to generate cryptographically secure random keys encoded in base64. You can simply put this key into a file and use it as a strong key for restic.
8
+
Resticprofile includes a tool to generate cryptographically secure, base64-encoded random keys. Save the key to a file and use it as a strong key for Restic.
9
9
10
-
- On Linux and FreeBSD, the generator uses `getrandom(2)` if available, `/dev/urandom` otherwise.
11
-
- On OpenBSD and macOS, the generator uses `getentropy(2)`.
12
-
- On other Unix-like systems, the generator reads from `/dev/urandom`.
13
-
- On Windows systems, the generator uses the uses the RtlGenRandom API.
14
-
- On JS/Wasm, the generator uses the Web Crypto API.
15
-
- On WASIP1/Wasm, the generator uses `random_get` from `wasi_snapshot_preview1`.
10
+
- On Linux, FreeBSD, Dragonfly, and Solaris, Reader uses `getrandom(2)`.
11
+
- On legacy Linux (< 3.17), it uses `/dev/urandom`.
12
+
- On macOS, and OpenBSD Reader, uses `arc4random_buf(3)`.
13
+
- On NetBSD, Reader uses the kern.arandom sysctl.
14
+
- On Windows, Reader uses the ProcessPrng API.
16
15
17
-
[Reference from the Go documentation](https://golang.org/pkg/crypto/rand/#pkg-variables)
16
+
[Reference from the Go cryto library documentation](https://golang.org/pkg/crypto/rand/#pkg-variables)
18
17
19
18
```shell
20
19
resticprofile generate --random-key
21
20
```
22
21
23
-
generates a 1024 bytes random key (converted into 1368 base64 characters) and displays it on the console
22
+
Generates a 1024-byte random key (converted to 1368 Base64 characters) and displays it in the console.
24
23
25
-
To generate a different size of key, you can specify the bytes length on the command line:
24
+
To generate a key of a different size, specify the byte length in the command line.
0 commit comments