「Xserver VPSでDebianサーバ構築/Webサーバ設定」の版間の差分

ナビゲーションに移動 検索に移動
$ curl https://SERVER/ip/
</nowiki>
 
==== systemd timer ====
 
~/.config/systemd/user/ip-addr.service
 
<nowiki>
[Unit]
Description=IP address
 
[Service]
Type=oneshot
ExecStart=curl -s https://SERVER/ip/ | mail -s "IP" MAIL
</nowiki>
 
~/.config/systemd/user/ip-addr.timer
 
<nowiki>
[Unit]
Description=IP address
 
[Timer]
OnCalendar=daily
AccuracySec=1h
Persistent=true
 
[Install]
WantedBy=timers.target
</nowiki>
 
==== cron ====
 
<nowiki>
0 6 * * * curl -s https://SERVER/ip/ | mail -s "IP" MAIL
</nowiki>
 
systemd timer

ナビゲーション メニュー