ä¾ãã°ãmy-programã¨ãããµã¼ãã¹ãå®ç¾©ãã¦ãï¼åæ¯ã«åããå ´åã®è¨å®
1. /etc/systemd/systemã®ä¸ã«è¨å®ãã¡ã¤ã«ãï¼ã¤(my-program.service, my-program.timer)é ç½®ãã
  1. 1. my-program.service
[Unit] Description=My Program Service (Oneshot) After=network.target [Service] Type=oneshot ExecStart=/path/to/my_program WorkingDirectory=/path/to User=worker-user Group=worker-group
  1. 2. my-program.timer
[Unit] Description=Run My Program every minute [Timer] OnCalendar=*:0/1 Unit=my-program.service [Install] WantedBy=timers.target
2. systemctlã§timerè¨å®ãæå¹å
sudo systemctl enable --now my-program.timer
3. è¨å®ç¢ºèª
sudo systemctl list-timers my-program.timer
4. æ¨æºåºåãã°ç¢ºèª( -f 㯠tail -fã¨åãç£è¦ãããªãã·ã§ã³)
sudo journalctl -u my-program.service -f