+22
0x0-prune.service
+22
0x0-prune.service
···
1
+
[Unit]
2
+
Description=Prune 0x0 files
3
+
After=remote-fs.target
4
+
5
+
[Service]
6
+
Type=oneshot
7
+
User=nullptr
8
+
WorkingDirectory=/path/to/0x0
9
+
BindPaths=/path/to/0x0
10
+
11
+
Environment=FLASK_APP=fhost
12
+
ExecStart=/usr/bin/flask prune
13
+
ProtectProc=noaccess
14
+
ProtectSystem=strict
15
+
ProtectHome=tmpfs
16
+
PrivateTmp=true
17
+
PrivateUsers=true
18
+
ProtectKernelLogs=true
19
+
LockPersonality=true
20
+
21
+
[Install]
22
+
WantedBy=multi-user.target
+9
0x0-prune.timer
+9
0x0-prune.timer
+8
-2
README.rst
+8
-2
README.rst
···
35
35
problem for example when streaming media files: It won’t be possible to seek,
36
36
and some ISOBMFF (MP4) files will not play at all.
37
37
38
-
To make files expire, simply create a cronjob that runs ``FLASK_APP=fhost
39
-
flask prune`` every now and then.
38
+
To make files expire, simply run ``FLASK_APP=fhost flask prune`` every
39
+
now and then. You can use the provided systemd unit files for this::
40
+
41
+
0x0-prune.service
42
+
0x0-prune.timer
43
+
44
+
Make sure to edit them to match your system configuration. In particular,
45
+
set the user and paths in ``0x0-prune.service``.
40
46
41
47
Before running the service for the first time, run ``FLASK_APP=fhost flask db upgrade``.
42
48