-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathribxz_update.service
50 lines (40 loc) · 1.11 KB
/
ribxz_update.service
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# /etc/systemd/system/ribxz-update.service
[Unit]
Description=RibXZ Database Update Service
After=docker.service
Requires=docker.service
[Service]
Type=oneshot
User=rtviii
Group=docker
WorkingDirectory=/home/rtviii/dev/riboxyz
# Environment setup
Environment=PYTHONUNBUFFERED=1
EnvironmentFile=/home/rtviii/dev/riboxyz/.env
# Execution
ExecStart=/bin/bash -c '\
source /home/rtviii/dev/riboxyz/ribxzvenv/bin/activate && \
python3 ribctl/ribd.py etl sync_all -t PTC -t STRUCTURE_PROFILE -t MMCIF --workers 6 --delay 2 && \
python3 ribctl/ribd.py db upload_all -w 6'
# Logging
StandardOutput=append:/var/log/ribxz/update.log
StandardError=append:/var/log/ribxz/update.error.log
# Restart settings
Restart=no
TimeoutStartSec=0
# Security settings
NoNewPrivileges=yes
ProtectSystem=full
ReadWritePaths=/var/log/ribxz /home/rtviii/dev/riboxyz
[Install]
WantedBy=multi-user.target
# /etc/systemd/system/ribxz-update.timer
[Unit]
Description=Run RibXZ database update every two weeks
Requires=ribxz-update.service
[Timer]
OnCalendar=*-*-1,15 00:00:00
RandomizedDelaySec=3600
Persistent=true
[Install]
WantedBy=timers.target