Why have you split the alias update into two steps? It's both safer and faster to make it an atomic operation (see [Index Aliases](https://www.elastic.co/guide/en/elasticsearch/reference/6.3/indices-aliases.html)), e.g.

    curl -X POST "localhost:9200/_aliases" -H 'Content-Type: application/json' -d'
    {
        "actions" : [
            { "remove" : { "index" : "user-20180631", "alias" : "userdata" } },
            { "add" :    { "index" : "user-20180701", "alias" : "userdata" } }
        ]
    }
    '

---
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB