Repository navigation
Expand file tree
/
Copy pathjustfile
More file actions
55 lines (45 loc) · 1.98 KB
/
Copy pathjustfile
File metadata and controls
55 lines (45 loc) · 1.98 KB
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
51
52
53
54
55
# Justfile for managing basedcount_bot systemd user services
# Interactively choose a recipe to run (default when running 'just' with no args).
default:
@just --choose
# List all available recipes.
ls:
@just --list
# Format this Justfile itself.
just-fmt:
just --fmt --unstable
# Create user systemd directory and symlink service and timer files
symlink-to-user-systemd:
mkdir -p ~/.config/systemd/user
ln -sfr systemd_services/basedcount_bot_backup.service ~/.config/systemd/user
ln -sfr systemd_services/basedcount_bot_backup.timer ~/.config/systemd/user
ln -sfr systemd_services/basedcount_bot.service ~/.config/systemd/user
systemctl --user daemon-reload
ls -alF ~/.config/systemd/user
# Remove symlinked service and timer files from the systemd user directory
remove-user-systemd:
rm -f ~/.config/systemd/user/basedcount_bot_backup.service
rm -f ~/.config/systemd/user/basedcount_bot_backup.timer
rm -f ~/.config/systemd/user/basedcount_bot.service
systemctl --user daemon-reload
ls -alF ~/.config/systemd/user
# Check the status of the main service and backup timer
status:
systemctl --user status basedcount_bot.service basedcount_bot_backup.timer
# Reload daemon, enable the main service and backup timer, and start them
start-all-services:
systemctl --user daemon-reload
systemctl --user enable --now basedcount_bot.service
systemctl --user enable --now basedcount_bot_backup.timer
# Stop the main service and backup timer
stop-all-services:
systemctl --user stop basedcount_bot.service
systemctl --user stop basedcount_bot_backup.timer
# Restart the main service and backup timer
restart-all-services:
systemctl --user restart basedcount_bot.service
systemctl --user restart basedcount_bot_backup.timer
# Stop and disable the main service and backup timer from starting on boot
disable-all-services:
systemctl --user disable --now basedcount_bot.service
systemctl --user disable --now basedcount_bot_backup.timer