# Snapshots not getting created by cron job

**URL:** <https://discuss.elastic.co/t/snapshots-not-getting-created-by-cron-job/201501>\
**Category:** Elasticsearch\
**Created:** [September 28, 2019, 6:22pm UTC](https://discuss.elastic.co/t/snapshots-not-getting-created-by-cron-job/201501 "2019-09-28T18:22:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul\_Kumar4](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rahul_kumar4/32/67369_2.png) [@Rahul\_Kumar4](https://discuss.elastic.co/u/Rahul_Kumar4)\
**Post date:** [September 28, 2019, 6:22pm UTC](https://discuss.elastic.co/t/snapshots-not-getting-created-by-cron-job/201501/1 "2019-09-28T18:22:08Z")

</div>

Hello,

I have a cron job set up in my crontab which is set to fire a snapshot every first minute of an hour. When I see the cron logs I can see that it triggered the task but I do not see the snapshots in Kibana client. I curl'ed the ElasticSearch instance directly and do not see the snapshots there either. When I try to run the cron script manually from one of the nodes it works fine and creates a snapshot but surprisingly the crontab job does not do so.

Here is my cron job setting

\< 1 \* \* \* \* root curl -v -k -s -X PUT [https://redacteduser:reactedpassword@localhost:9201/\_snapshot/s3\_backup\_repository/\<snapshot-{now%2Fh{yyyy.mm.dd-hh}}\>?wait\_for\_completion=true](https://redacteduser:reactedpassword@localhost:9201/_snapshot/s3_backup_repository/%3Csnapshot-%7Bnow%2Fh%7Byyyy.mm.dd-hh%7D%7D%3E?wait_for_completion=true) \>\> /opt/elasticsearch/system/system.log 2\>&1 /\>

This cron job is set on all the three EC2 instances in our ES cluster.

Here is the row in cron log in /var/log/ which shows the script was triggered per the cron schedule. (I see this in all the 3 EC2 instances in ES Cluster all with the same timestamp).

\< Sep 28 18:01:01 ip-10-7-22-136 CROND[17730]: (root) CMD (curl -v -k -s -X PUT [https://redacteduser:redactedpassword@localhost:9201/\_snapshot/s3\_backup\_repository/](https://redacteduser:redactedpassword@localhost:9201/_snapshot/s3_backup_repository/)) /\>

The system.log file in all the 3 instances on path /opt/elasticsearch/system do not have any trace of the snapshot triggered by the cron tasks.

Any idea why this could be happening? Is it because all the 3 instances in the cluster try to trigger the snapshot all the same time?

Thanks,  
Rahul

---

<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:** [October 26, 2019, 6:22pm UTC](https://discuss.elastic.co/t/snapshots-not-getting-created-by-cron-job/201501/2 "2019-10-26T18:22:09Z")

</div>

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