Skip to content

Commit 2b7bb26

Browse files
committed
systemd: add leading zeroes to hours + minutes
1 parent 4356cd1 commit 2b7bb26

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pyinfra_borgbackup/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ def deploy_borgbackup(
117117
src=importlib.resources.files(__package__).joinpath("borgbackup.timer.j2"),
118118
dest="/etc/systemd/system/borgbackup.timer",
119119
mode="644",
120-
minute=str(random.randint(0, 59)),
121-
hour=str(random.randint(0, 4)),
120+
minute=f"{random.randint(0, 59):02d}",
121+
hour=f"{random.randint(0, 4):02d}",
122122
)
123123
systemd.service(
124124
name="Setup borgbackup timer",

0 commit comments

Comments
 (0)