# \[slm\] Snapshots are just ignored when scheduled, but manual \_execute works

**URL:** <https://discuss.elastic.co/t/slm-snapshots-are-just-ignored-when-scheduled-but-manual-execute-works/321429>\
**Category:** Elasticsearch\
**Tags:** slm-snapshot-lifecycle-management\
**Created:** [December 16, 2022, 7:14pm UTC](https://discuss.elastic.co/t/slm-snapshots-are-just-ignored-when-scheduled-but-manual-execute-works/321429 "2022-12-16T19:14:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![stouch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stouch/32/99470_2.png) [@stouch](https://discuss.elastic.co/u/stouch)\
**Post date:** [December 16, 2022, 7:14pm UTC](https://discuss.elastic.co/t/slm-snapshots-are-just-ignored-when-scheduled-but-manual-execute-works/321429/1 "2022-12-16T19:14:54Z")

</div>

I have a got a S3 repository and a slm policy. I can execute this policy manually : Snapshot is created, last success of this manual execution appears well, no failures. So I set up the scheduled cron :

After the cron time, nothing happens. No failures. (Even in ES logs) Nothing.  
But I can again \_execute the policy to create the snapshot.

It is not about UTC hour issue or something like that because I waited enough to be sure the CRON are just ignored.

It seems to be the same case than [Snapshots not running as scheduled](https://discuss.elastic.co/t/snapshots-not-running-as-scheduled/295714)

---

<div class="post-metadata">

**Author:** ![stouch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stouch/32/99470_2.png) [@stouch](https://discuss.elastic.co/u/stouch)\
**Post date:** [December 19, 2022, 2:47pm UTC](https://discuss.elastic.co/t/slm-snapshots-are-just-ignored-when-scheduled-but-manual-execute-works/321429/2 "2022-12-19T14:47:23Z")

</div>

For the record, I use the version 8.5.2 of elasticsearch, and my policy is this one :

nightly-snapshots :

```auto
  "policy": {
	"name": "<es-nightly-snap-{now/d}>",
	"schedule": "0 30 1 * * ?",
	"repository": "es-snapshots",
	"config": {
		"indices": [
			"*"
		],
		"feature_states": [],
		"ignore_unavailable": false,
		"include_global_state": true
	},
	"retention": {
		"expire_after": "10d",
		"min_count": 3,
		"max_count": 10
	}
}

```

The slm never triggers so I had to setup a crontab -e :  
`30 1 * * * curl --silent -X POST http://localhost:9200/_slm/policy/nightly-snapshots/_execute &>/dev/null`  
And so the execution works with this one.

I'd really appreciate any help 🙂

---

<div class="post-metadata">

**Author:** ![gpavinteractiv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gpavinteractiv/32/105210_2.png) [@gpavinteractiv](https://discuss.elastic.co/u/gpavinteractiv)\
**Post date:** [December 30, 2022, 11:42am UTC](https://discuss.elastic.co/t/slm-snapshots-are-just-ignored-when-scheduled-but-manual-execute-works/321429/3 "2022-12-30T11:42:28Z")

</div>

exact same problem for us on an elastic/kibana 7.15.8 cluster  
cron jobs are not fired; snapshots are never created nor shown as failed, nothing in logs.

Manual execution of the policies works

```auto
GET _slm/policy/hourly-snapshots
{
  "hourly-snapshots" : {
    "version" : 4,
    "modified_date_millis" : 1672400363794,
    "policy" : {
      "name" : "<hourly-snapshot-{now/H}>",
      "schedule" : "0 0 * * * ?",
      "repository" : "snaps-ELK-POC",
      "config" : {
        "ignore_unavailable" : true,
        "partial" : true
      },
      "retention" : {
        "expire_after" : "2d",
        "max_count" : 48
      }
    },
    "next_execution_millis" : 1672404000000,
    "stats" : {
      "policy" : "hourly-snapshots",
      "snapshots_taken" : 0,
      "snapshots_failed" : 0,
      "snapshots_deleted" : 0,
      "snapshot_deletion_failures" : 0
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![gpavinteractiv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gpavinteractiv/32/105210_2.png) [@gpavinteractiv](https://discuss.elastic.co/u/gpavinteractiv)\
**Post date:** [December 30, 2022, 12:10pm UTC](https://discuss.elastic.co/t/slm-snapshots-are-just-ignored-when-scheduled-but-manual-execute-works/321429/4 "2022-12-30T12:10:03Z")

</div>

this helped me : [kibana - Elasticsearch : Snapshots not executed automatically (cron schedule issue) - Stack Overflow](https://stackoverflow.com/questions/71644703/elasticsearch-snapshots-not-executed-automatically-cron-schedule-issue)

```auto
POST _slm/stop
POST _slm/start

```

---

<div class="post-metadata">

**Author:** ![stouch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stouch/32/99470_2.png) [@stouch](https://discuss.elastic.co/u/stouch)\
**Post date:** [December 30, 2022, 1:28pm UTC](https://discuss.elastic.co/t/slm-snapshots-are-just-ignored-when-scheduled-but-manual-execute-works/321429/5 "2022-12-30T13:28:18Z")

</div>

I spent hours on this, thank you so much.

Your solution worked for us ( GET /\_slm/status was returning STOPPED ...)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 27, 2023, 1:28pm UTC](https://discuss.elastic.co/t/slm-snapshots-are-just-ignored-when-scheduled-but-manual-execute-works/321429/6 "2023-01-27T13:28:41Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
