mastodon.zunda.ninja is one of the many independent Mastodon servers you can use to participate in the fediverse.
Zundon is a single user instance as home of @zundan as well as a test bed for changes of the code.

Administered by:

Server stats:

1
active users

Ubuntu Server 22.04を設定してるんだけどcrontab効かないし/etc/rc.local無いし

ifupdown無いし

zunda

ナウなヤングはsystemd-timerらしいでつw

1. 今まで/etc/cron.daily/に放り込んでたスクリプトをどこか適当なパスに置く。何かメールで知らせて欲しければスクリプトの中でmailコマンドにパイプする
2. /etc/systemd/system/タスク名.serviceとして下記のファイルを置き、rootユーザーrootグループの所有にしてchmod a+xする (chmodは必要なさそう)

[Unit]
Description=説明

[Service]
Type=oneshot
ExecStart=/スクリプトのパス

3. /etc/systemd/system/タスク名.timerとして下記のファイルを置き、rootユーザーrootグループの所有にしてchmod a+xする (chmodは必要なさそう)

[Unit]
Description=説明

[Timer]
OnCalendar=daily

[Install]
WantedBy=timers.target

4. 下記のコマンドでタイマを次のブート時から有効にして今回の起動中にも起きるようにする

sudo systemctl enable タスク名.timer
sudo systemctl start タスク名.timer

5. 下記のコマンドで状況を確認できる

systemctl -l --no-pager list-timers タスク名.timer

6. やれやれ。