From e1e8ae1c313123e9bc976d5cc5f7d9e8d4db1caa Mon Sep 17 00:00:00 2001 From: AIZAWA Hina Date: Wed, 20 Nov 2024 07:09:21 +0900 Subject: [PATCH] cron: switch splatoon{2,3}ink/update to systemd timer --- data/systemd/statink-update-s2ink.service | 11 +++++++++++ data/systemd/statink-update-s2ink.timer | 8 ++++++++ data/systemd/statink-update-s3ink.service | 11 +++++++++++ data/systemd/statink-update-s3ink.timer | 8 ++++++++ schedule/schedule.php | 1 - schedule/schedule/schedule.php | 17 ----------------- 6 files changed, 38 insertions(+), 18 deletions(-) create mode 100644 data/systemd/statink-update-s2ink.service create mode 100644 data/systemd/statink-update-s2ink.timer create mode 100644 data/systemd/statink-update-s3ink.service create mode 100644 data/systemd/statink-update-s3ink.timer delete mode 100644 schedule/schedule/schedule.php diff --git a/data/systemd/statink-update-s2ink.service b/data/systemd/statink-update-s2ink.service new file mode 100644 index 000000000..b6382166e --- /dev/null +++ b/data/systemd/statink-update-s2ink.service @@ -0,0 +1,11 @@ +[Unit] +Description=Run stat.ink splatoon2-ink/update +After=paths.target multi-user.target network.target network-online.target NetworkManager.service + +[Service] +Type=oneshot +ExecStart=/var/www/sites/stat.ink/app.dep/current/yii splatoon2-ink/update +SyslogIdentifier=statink-update-s2ink +WorkingDirectory=/var/www/sites/stat.ink/app.dep/current +User=stat.ink +Group=stat.ink diff --git a/data/systemd/statink-update-s2ink.timer b/data/systemd/statink-update-s2ink.timer new file mode 100644 index 000000000..9f5287ce5 --- /dev/null +++ b/data/systemd/statink-update-s2ink.timer @@ -0,0 +1,8 @@ +[Unit] +Description=Run stat.ink splatoon2-ink/update (timer) + +[Timer] +OnCalendar=*:04 + +[Install] +WantedBy=timers.target diff --git a/data/systemd/statink-update-s3ink.service b/data/systemd/statink-update-s3ink.service new file mode 100644 index 000000000..aa673386f --- /dev/null +++ b/data/systemd/statink-update-s3ink.service @@ -0,0 +1,11 @@ +[Unit] +Description=Run stat.ink splatoon3-ink/update +After=paths.target multi-user.target network.target network-online.target NetworkManager.service + +[Service] +Type=oneshot +ExecStart=/var/www/sites/stat.ink/app.dep/current/yii splatoon3-ink/update +SyslogIdentifier=statink-update-s3ink +WorkingDirectory=/var/www/sites/stat.ink/app.dep/current +User=stat.ink +Group=stat.ink diff --git a/data/systemd/statink-update-s3ink.timer b/data/systemd/statink-update-s3ink.timer new file mode 100644 index 000000000..a8280c43b --- /dev/null +++ b/data/systemd/statink-update-s3ink.timer @@ -0,0 +1,8 @@ +[Unit] +Description=Run stat.ink splatoon3-ink/update (timer) + +[Timer] +OnCalendar=*:02 + +[Install] +WantedBy=timers.target diff --git a/schedule/schedule.php b/schedule/schedule.php index 75894d4a0..cd981073a 100644 --- a/schedule/schedule.php +++ b/schedule/schedule.php @@ -10,5 +10,4 @@ require __DIR__ . '/schedule/salmon2.php'; require __DIR__ . '/schedule/salmon3.php'; -require __DIR__ . '/schedule/schedule.php'; require __DIR__ . '/schedule/user-json.php'; diff --git a/schedule/schedule/schedule.php b/schedule/schedule/schedule.php deleted file mode 100644 index e7dd0ef56..000000000 --- a/schedule/schedule/schedule.php +++ /dev/null @@ -1,17 +0,0 @@ -command('splatoon2-ink/update') - ->cron('4 * * * *'); - -$schedule - ->command('splatoon3-ink/update') - ->cron('2 * * * *');