Question about scheduling the first Saturday of January using Cron and date command

オープン
#571 コメント 8 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
go
領域
devops

調査の方向性

Start by reading the configuration reference and the code that expands environment variables and schedules cron expressions; the issue names no files or tests. Check whether command substitution or special cron syntax is supported, then document or implement a supported way to run a job on January’s first Saturday. The thread has had no comment for 342 days, so confirm the discussion has a settled direction before starting.

索引モデルが issue の本文から書いたものです。

説明

documentation support

What are you trying to do?
I am trying to schedule a Cron job that runs specifically on the first Saturday of January at midnight. I noticed that the Cron expression 0 0 1 ? 1 SAT#1 * can achieve this, but according to the configuration reference it has not allowed special characters.
Likewise, I want to know if a similar approach using standard cron syntax and the date command is supported.

What is your current configuration?
Here is the Cron expression I am considering:

# run every Saturday in January at midnight, check if it's the first Saturday
BACKUP_CRON_EXPRESSION="0 0 * 1 6 [ "$(date +\%d)" -le 7 ]"

Log output
time=2025-04-05T17:35:13.058+02:00 level=ERROR msg="Fatal error running command: unexpected command substitution at 1:38" error="main.(*command).runInForeground: error scheduling: main.(*command).schedule: error sourcing configuration: main.sourceConfiguration: error loading config files: main.loadConfigsFromEnvFiles: error reading config file /etc/dockervolumebackup/conf.d/04yearly.conf: main.source: error expanding env: unexpected command substitution at 1:38"

Additional context
I would like to confirm if this approach is valid in your Cron implementation. If it is not supported, could you recommend an alternative method to schedule a job for the first Saturday of January? Any guidance or examples would be greatly appreciated.

主要言語
Go
スター
4.1k
フォーク
157
平均マージ
4時間 35分
マージ済み PR(30日)
15

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

offen/docker-volume-backup のほかの issue

offen/docker-volume-backup の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。