システムタイマーとマウントが見つかりません。

システムタイマーとマウントが見つかりません。

4時間ごとに実行されるようにシステム時間を設定しようとしています。タイマーが実行されると、スクリプトを実行して一部のデータファイルを更新します。フォローするsystemdタイマーは2時間ごとに毎時30分で動作しますか?そして15分ごとにシステムタイマー

文書/etc/systemd/system/ftc-data.service:

[Unit]
Description=Fetch FTC Do Not Call data files

[Service]
Type=oneshot
ExecStart=/var/ftc/ftc-data/fetch-data.sh

文書/etc/systemd/system/ftc-data.timer:

[Unit]
Description=Run ftc-data.service every 4 hours

[Timer]
OnCalendar=00/4:00

[Install]
WantedBy=timers.target

ここで問題が発生します。

systemctl enable /etc/systemd/system/ftc-data.timer
systemctl start  /etc/systemd/system/ftc-data.timer
systemctl enable /etc/systemd/system/ftc-data.service

コマンドの結果は次のとおりです。

# systemctl enable /etc/systemd/system/ftc-data.timer

# systemctl start  /etc/systemd/system/ftc-data.timer
Failed to start etc-systemd-system-ftc\x2ddata.timer.mount: Unit etc-systemd-system-ftc\x2ddata.timer.mount not found.

# systemctl enable /etc/systemd/system/ftc-data.service
The unit files have no installation config (WantedBy, RequiredBy, Also, Alias
settings in the [Install] section, and DefaultInstance for template units).
This means they are not meant to be enabled using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
   .wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
   a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
   D-Bus, udev, scripted systemctl call, ...).
4) In case of template units, the unit is meant to be enabled with some
   instance name specified.

を有効にしようとすると問題が発生しているようですftc-data.timer。理解しようとするFailed to start etc-systemd-system-ftc\x2ddata.timer.mount: Unit etc-systemd-system-ftc\x2ddata.timer.mount not found.ところで検索をしてみると安打がないですね。投稿を見つけました。初心者コーナー»ユニットタイマーところで、systemdのタイマーがあまりにも汚れていて、この人は再びcronを使い始めました。

ここにいるマウントシステムドキュメントですが、読んだ後に問題が何なのかわかったらクソ。ファイルシステムのマウントがどのように関連しているかわかりません。私がしたいのは、4時間ごとにスクリプトを実行することです。

今は本当に恋しいですcroncronシンプルで効果的です。もっと複雑なものに置き換えられましたが、うまくいきません。ため息をつく...

(systemdに加えて)何を修正する必要がありますか?


これは強制モードのSELinuxを使用するFedora 29サーバーです。これは以下に関連する可能性があります。

# ls -Zd /var/ftc/ftc-data/fetch-data.sh
unconfined_u:object_r:httpd_sys_content_t:s0 /var/ftc/ftc-data/fetch-data.sh

Webサーバーは/var/ftc/ftc-data/ディレクトリ内の文書を提供する必要があるため、アクセスできます。Nginxサブディレクトリの権限拒否の問題を解決するには?

ベストアンサー1

あなたは提供する必要があります名前ファイルではなくデバイスへのパスです。

以下を行う必要があります。

systemctl enable ftc-data.timer
systemctl start ftc-data.timer
systemctl enable ftc-data.service

おすすめ記事