Cronjob for curator - elasticsearch

I have installed ELK and the latest curator 4.0. I would like to made it regularly run with cronjob in linux.
I have installed .curator at the linux home, i.e. cd~.
I have typed crontab -e.
I input the following statement * * * * * /.curator curator action.yml
Is this setting right? How should I check if it is running or not?

1 - For curator installation checkout: https://www.elastic.co/guide/en/elasticsearch/client/curator/current/installation.html
2 - You can edit crontab entries like that. Thats OK.
3 - If you install curator correctly you can run:
* * * * * curator /path/to/action/file/action.yml
That will run curator every minute with the specified action.yml file.
For crontab log checkout: https://askubuntu.com/questions/56683/where-is-the-cron-crontab-log

You can also set a path for the log file in the configuration.
logging:
loglevel: INFO
logfile: /home/logs/curator.log
logformat: default

Related

Container is Exiting on start

Following the Getting Started guide for Starting a Local Cluster in Docker https://www.cockroachlabs.com/docs/stable/start-a-local-cluster-in-docker.html. The problem is that the container immediately exits.
Tried adding tail -f /dev/null but it did not work. Though pretty sure it is not supposed to be needed.
Running on Docker for Windows
Docker version 18.09.2, build 6247962
Tried with -it flag and the error listed is
*
* WARNING: RUNNING IN INSECURE MODE!
*
* - Your cluster is open for any client that can access <all your IP addresses>.
* - Any user, even root, can log in without providing a password.
* - Any user, connecting as root, can read or write any data in your cluster.
* - There is no network encryption nor authentication, and thus no confidentiality.
*
* Check out how to secure your cluster: https://www.cockroachlabs.com/docs/v19.1/secure-a-cluster.html
*
*
* ERROR: failed to start server: could not create temp storage: could not open rocksdb instance: IO error: While fsync: a directory: Invalid argument
*
Failed running "start"

How to cron job setup in Amazon ec2

I have an Amazon EC2 instance running my website. I need to setup a Cron Job to run my file every 12hours.
if file setup via command line so please give a detail step wise.
Does anyone have any advise?
Thanks for your time.
I recently began using Amazon's linux distro on ec2 instances and after trying all kinds of things for cron all I needed was:
sudo service crond start
crontab -e
This allowed me to set a cron job as "ec2-user" without specifying the user. For example:
0 12 * * * python3 example.py
In fact, specifying a user here prevented it from running. I also posted this here.
It's just normal cron.
See: HowTo: Add Jobs To cron Under Linux or UNIX?

Amazon EC2 automatic reboot and script running

I'm trying to get a amazon ec2 instance to automatically reboot each 2 hours, and after run a shell (.sh) script on startup. Any ideas?
For rebooting after 2 hours, if it is Ubuntu (or Debian based distro) just put on root's cron (by entering sudo crontab -e):
* */2 * * * /sbin/shutdown -r now
I am very curious as to why you need to reboot every 2 hours... I hope this is not a production server... but you could run a cronjob to do the rebooting, what type of instance do you have, is it linux or windows?
I have a centos instance and I have modified /etc/rc.d/rc.local to run a script after booting up but then again you could easily run a script via cronjob to check whether something is running or not...
I guess we need more information from you as to what you are trying to do and what type of instance you have.

unable to auto start/stop aws ec2 instance

i wanted to automate the ec2 instance's start & stop and configured the crontab on an instance x. I followed these steps
1) Edited the crontab -e of instance X.
2) and added these lines
15 04 * * * username ec2-start-instances i-f1814c90
15 07 * * * username ec2-stop-instances i-f1814c90
10 10 * * * username ec2-start-instances i-f1814c90
3) and restarted the cron using sudo /etc/init.d/cron restart
But still am unable to either start or stop the ec2 instance using cronjob.
thanks,
Anand
Most likely the issue is that the AWS data need to run the ec2 start and stop commands are not in the cron environment.
Its better to write a separate script that does this, instead of of making the ec2 commands on the cron like that.
This is why AWS Data Pipeline is for (working fine):
https://aws.amazon.com/premiumsupport/knowledge-center/stop-start-ec2-instances/
Just mind the trap: --region eu-west-1 NOT --region eu-west-1a (which is an availability zone).
I'd suggest to Schedule EC2 Start / Stop using AWS Lambda
You don't need anything more than a small script or two that you schedule. No instance to launch, just a quick invocation of the script you have built. Pick the programming language of your choice and use the AWS SDK to perform instance operations. A quite lightweight solution,.

Cron on XAMPP (Mac OS)

I have installed XAMPP server on my Mac OS, how to setup a cron job on it?
My requirement is that i want to call a php script at regular intervals .
Thanks
there is a good article here how to setup cron job on Mac OS X
you would have to edit a textfile(crontabtaskfile)and add for example
0 */1 * * * php path/to/yourphp.php
this would give you a task running every hour (1:00, 2:00) .
and use crontab crontabtaskfile
Cronnix
http://code.google.com/p/cronnix/
or the command line for editing cron tabs.

Resources