初始化提交
This commit is contained in:
19
爬虫项目的相关命令/test_yt_data_update/systemd/yt_update.service
Normal file
19
爬虫项目的相关命令/test_yt_data_update/systemd/yt_update.service
Normal file
@@ -0,0 +1,19 @@
|
||||
[Unit]
|
||||
Description=Daily update_yt.py script
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
WorkingDirectory=/data/webapps/test_yt_data_update
|
||||
ExecStart=/bin/bash -c '
|
||||
. ~/.bashrc &&
|
||||
conda activate py310 &&
|
||||
/usr/bin/flock -n /tmp/update_yt.lock \
|
||||
python update_yt.py >> logs/update_yt.log 2>&1
|
||||
'
|
||||
StandardOutput=append:/data/webapps/test_yt_data_update/logs/systemd_update_yt.log
|
||||
StandardError=append:/data/webapps/test_yt_data_update/logs/systemd_update_yt.log
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
Reference in New Issue
Block a user