File: 04-cron-usage.md

package info (click to toggle)
php-jolicode-jolinotif 3.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 772 kB
  • sloc: php: 1,815; makefile: 19; ansic: 11
file content (30 lines) | stat: -rw-r--r-- 859 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# CRON usage

## Configuration for CRON

Cronjobs are usually CLI scripts. But JoliNotif's Unix/Linux drivers are GUI
applications. This means you need to specify the display where the notification
will be sent.

You can achieve this by setting the `XDG_RUNTIME_DIR` environment variable in your
cronjob:

```
* * * * * XDG_RUNTIME_DIR=/run/user/$(id -u) php /path/to/your/script
```

> **Note**
> On some system, you may also/instead need to set DISPLAY env var and/or to
> run `xhost +local:`. For more information, please have a look at
> [https://help.ubuntu.com/community/CronHowto#GUI_Applications](https://help.ubuntu.com/community/CronHowto#GUI_Applications)

## Next readings

* [CLI usage](05-cli-usage.md)

Previous pages:

* [Drivers](03-drivers.md)
* [Notification](02-notification.md)
* [Basic usage](01-basic-usage.md)
* [README](../README.md)