浏览代码

added config files for the systemd.timer environment and documentation for use

master
Wouter Horlings 6 年前
父节点
当前提交
0b7b9da40e
共有 3 个文件被更改,包括 45 次插入0 次删除
  1. +27
    -0
      systemd_timer_files/README.md
  2. +9
    -0
      systemd_timer_files/pythontaskcheck.service
  3. +9
    -0
      systemd_timer_files/pythontaskcheck.timer

+ 27
- 0
systemd_timer_files/README.md 查看文件

@@ -0,0 +1,27 @@
# Installation of timer files

# Setting the correct path
In `pythontaskcheck.timer` replace `[[path_to_repo]]` with the absolute path to the repo root.

# Setting up systemd.timer
Move `pythontaskcheck.timer` and `pytontaskcheck.service` to the `$XDG_RUNTIME_DIR/systemd/user/` dir.
Run the following commands to enable the scheduled execution.
```
$ systemctl --user deamon-reload
$ systemctl --user enable pythontaskcheck.timer
$ systemctl --user start pythontaskcheck.timer
```

# Check if everything is working
```
$ systemctl --user start pythontaskcheck.service
```
executes the script via systemd.
```
$ systemctl list-timers --user
```
shows the list with timers. Yours should be listed here.

# updating the time.
Current setup will trigger the script every 5 minutes from 9:00 till 17:55


+ 9
- 0
systemd_timer_files/pythontaskcheck.service 查看文件

@@ -0,0 +1,9 @@
[Unit]
Description="Start python scripts that checks Todoist Status and reminds user"

[Service]
WorkingDirectory=[[path_to_repo]]
ExecStart=[[path_to_repo]]/venv/bin/python3 [[path_to_repo]]/taskcheck.py

[Install]
WantedBy=graphical.target

+ 9
- 0
systemd_timer_files/pythontaskcheck.timer 查看文件

@@ -0,0 +1,9 @@
[Unit]
Description="Run Python script multiple times per day."

[Timer]
OnCalendar=Mon..Fri *-*-* 09..17:00/5:00
Unit=pythontaskcheck.service

[Install]
WantedBy=graphical.target

正在加载...
取消
保存