1. service 파일 생성
cd /etc/sytemd/sytemd
vi {서비스 명}.service
2. service 파일 내용 기입
[Unit]
Description=["디스크 명령어 입력시 알럿 보냄"]
After=multi-user.target
[Service]
Type=idle
ExecStart=/usr/bin/python3 /home/admin/es_alert/disk_alert_update.py
[Install]
WantedBy=multi-user.target
3. systemctl로 서비스 활성화
systemctl start {서비스 명}.service
systemctl enable {서비스 명}.service
'인프라 > Linux' 카테고리의 다른 글
libvirt default storage pool 변경하기 (0) | 2025.01.10 |
---|---|
Mysql 유저 및 DB 추가 (0) | 2024.08.21 |
Linux 서버에서 윈도우로 파일 전송하는 방법(cifs, rsync) (1) | 2024.07.01 |
netplan에서 gateway4 안될 때? routes를 사용 (0) | 2024.05.01 |