-
Notifications
You must be signed in to change notification settings - Fork 0
/
services.sh
executable file
·36 lines (27 loc) · 1.13 KB
/
services.sh
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
#!/bin/bash
start() {
. /opt/homebrew/anaconda3/bin/activate && conda activate /opt/homebrew/anaconda3/envs/assistant && \
/opt/homebrew/anaconda3/envs/assistant/bin/python /Users/simon/dev_projects/gen-ai/cache_server.py > /Users/simon/dev_projects/gen-ai/cache_server.log 2>&1 &
. /opt/homebrew/anaconda3/bin/activate && conda activate /opt/homebrew/anaconda3/envs/assistant && \
/opt/homebrew/anaconda3/envs/assistant/bin/python /Users/simon/dev_projects/gen-ai/rss_feeds.py > /Users/simon/dev_projects/gen-ai/rss_feeds.log 2>&1 &
# Note: Both commands now run in the background with '&' at the end
}
stop() {
pkill -f rss_feeds.py
pkill -f cache_server.py
# kill $(cat /tmp/rss_feeds.pid)
# rm /tmp/rss_feeds.pid
}
case "$1" in
start) start ;;
stop) stop ;;
restart) stop; start ;;
*) echo "usage: $0 start|stop|restart" >&2
exit 1
;;
esac
# ./manage_rss_feeds.sh start
# ./manage_rss_feeds.sh stop
# ./manage_rss_feeds.sh restart
# pkill -f rss_feeds.py
# ps aux | grep rss_feeds.py