]> git.mxchange.org Git - fba.git/commitdiff
added service for block fetching
authorEnju Aihara <5-EnjuAihara@users.noreply.gitlab.varis.social>
Fri, 4 Mar 2022 18:25:29 +0000 (19:25 +0100)
committerEnju Aihara <5-EnjuAihara@users.noreply.gitlab.varis.social>
Fri, 4 Mar 2022 18:25:29 +0000 (19:25 +0100)
README.md
services/fetch_blocks.service [new file with mode: 0644]

index 3ef6a4587f2573b5c3aee8f1e8c12d9fc0652c9d..d0700f4518758687d7ba8047a8caae72d1cb32e5 100644 (file)
--- a/README.md
+++ b/README.md
@@ -26,7 +26,12 @@ systemctl start mastodon_api
 
 Fill the database with blocks.
 
-`python fetch_blocks.py`
+Make sure to edit the `User` and `WorkingDirectory` of the service file accordingly.
+
+```
+sudo cp services/fetch_blocks.service /etc/systemd/system
+systemctl start fetch_blocks
+```
 
 ## License
 
diff --git a/services/fetch_blocks.service b/services/fetch_blocks.service
new file mode 100644 (file)
index 0000000..908b80e
--- /dev/null
@@ -0,0 +1,10 @@
+[Unit]
+Description=Fetch blocks
+
+[Service]
+Type=simple
+Restart=always
+RestartSec=1
+User=
+WorkingDirectory=/fedi-block-api
+ExecStart=python fetch_blocks.py 
\ No newline at end of file