How to configure cron tasks between dhru fusion and Hostinger? - cron

I'm following the instructions in this video: https://www.youtube.com/watch?v=GTsftQBWrGc to do the setup, but it doesn't work.
According to hostinger support cron jobs work fine, but on dhru platform still not working.
I attach screenshots with the settings I use:
Thanks for your comments.
Cron tasks configured in hostinger, Configuring cron tasks in hostinger y Cron commands provided by dhru

Related

How to make a schedule report feature using nodejs cron job ? (problem with aws autoscaling)

I am working on "schedule report" feature but facing a problem because of AWS auto scaling feature.
This is how I am executing this feature:
Step 1: User will provide "hour", "minutes" and "report daily or not flag" as input to backend.
Step 2: Backend will make a cron job, store "cron job id" in database and send reports to user via mail according to cron job schedule.
PROBLEM: If the server shuts down and then restarts; then according to start-up script all cron jobs will be started... now if my server has heavy load then AWS auto-scaling will start and on each EC2 instance start-up script will be executed and the same cron-job will be running on different instances.
Therefore same cron job will be running on different EC2 instances and hence user will receive the same emails multiple times (this is the error iam facing, how to solve this issue)
What I have thought till now: We can store a flag in database , if flag is true then cron job will start else will not start. So if one ec2 instance is running cron job, it will set flag to true then other instances won't start it. But the issue is that how to unset the flag if serve suddenly shuts down or such other case.
I am not able to find answer to such a architectural design based issue on net. Is the above approach practical; if then how to properly do it? What is the best way to implement these kind of architectures? Any help will be great, Thanks!
I have faced the same issue.
You can follow 2 ways:
You can run a separate ec2 instance (with vertical scaling) dedicated for cron job.
you can store instance id and cron job status to match running cron job instance

How to start/stop/edit cron job from Node.js?

I have did some search for this question, but something useful didn't came out. So, i decided to create a new thread.
Problem Description
I am making CLI for installation of our server, so one of the pre-requisite is that cron job should be running. So, to accomplish same, i want to add some cron jobs and restart the service. Is it possible via Node.js
Checkout this module, will this help you?
https://github.com/ncb000gt/node-cron

How to schedule running Moodle cron using windows scheduler and the cron URL?

I have Moodle 2.5 on a linux server, i dont know anything about scheduling cron.
I can execute the cron from a webpage by going to the URL like this http://moodle2.domainaname.org/admin/cron.php
I would like to schedule this cron to run on the Linux server (by calling this web address) from a windows server / windows scheduler .. Is this possible? if so how?
Thanks
Need to set cron job for it. Go through following link.
I hope it will be useful for you.
http://v1.corenominal.org/howto-setup-a-crontab-file/

setting up a cron job on cpanel that dn't have the cron job option

please can anyone give me a clue on how to Set up a cronjob to execute my API callback URL once every 15 mins, since my control panel does not have that ability, please i need specifications with examples because am still at the armature level, example: i want to setup a cronjop to execute this API call back url http://shop.site.com/modules/cashenvoy/validation.php every 15 mins and my control panel dn't have the option for direct cronjob setting, please how do i go about to setup a cronjob to execute this URL, thanks ur suggestions is appreciated.
Try to use crontab:
# to list current cron jobs
sudo crontab -u username -l
# edit the cron list
sudo crontab -u username -e
This proves a terminal where you can edit the cron jobs.
Insert the following:
*/15 * * * * curl -s http://shop.site.com/modules/cashenvoy/validation.php
This will every 15 minutes silently call the wanted website.
A third party cron job provider may help: http://www.easycron.com.
Disclaimer: I work for easycron.com.
This demo assumes you've already logged in to cPanel
Now let's learn how to setup a cron job
1) Click the Cron Jobs icon
2) Enter the email address where you want the cron job results sent after each time it runs
3) Now you have to define exactly when and how often you want the cron job to run. This is made easier by using one of the pre-defined or common settings
Notice that by choosing a common setting, all fields are filled in automatically. This also helps you understand what each field means
If you have a shared hosting account, crons should not be made more regular than once every 10 minutes.
4) Let's choose Once a week
5) Next, enter the command of the script you want to run, including the path (from root). If you are on shared hosting - add nice -n 15 to the end. This ensures that the server gives the cron a lower priority than critical system processes, helping maintain stability and server uptime.
Remember to add "nice -n 15" to the end of your command!
6) When ready, click Add New Cron Job
That's it! The cron job has been set as you can see here. You can create additional cron jobs, and edit or delete existing ones
This is the end of the tutorial. You now know how to setup cron jobs in cPanel

Jenkins to monitor external cron jobs

We are using a dedicated Amazon Ubuntu ec2 instance as Cron server, which executed 16 cron jobs at different time intervals i.e, 10 cron jobs in morning 4:15 - 7:15 and the rest # 23:00 - 23:50. I get the results via email. I want to configure something, which shoots email message at the end of they day listing the cron jobs that are executed successfully and the one that failed.
I have a jenkins configured ubuntu instance for auto-building Dev, Beta, Staging & Live environments. Can i add these cron jobs(shell scripts) as external jobs in the jenkins and monitor them. Is it possible?
Definitely possible! You can monitor external cron jobs as described here:
https://wiki.jenkins-ci.org/display/JENKINS/Monitoring+external+jobs
You can also add cron job (-like behavior) to Jenkins by creating a freestyle software project and add "Execute shell" as build process.
It's a bit more convenient since you can also trigger the execution via Jenkins ("Build now").
You might be able to combine the Jenkins monitor external job project type with a matrix project. At the very least the former will enable you to monitor the cron jobs individually.
Alternatively you could have the last monitored cron job of the day trigger building a project that checks the status of all the cron jobs (for example by retrieving and comparing the build numbers of the last and the last successful builds) and sends an email accordingly. The email plugin might be useful for the latter.
Check the CPAN or do some web digging for shell or perl script for managing cron jobs and extend its behaviour to do some reporting which you can render using HTML. Alternatively write a servlet and a some function calls to do just that.
This becomes your own standalone monitor application, which can sit in jenkins or deployed independently. If you choose to add it to jenkins, then add the reporting HTML file and its scripts to the container holding deployed web files for jenkins, word of advice place your files and script in a separate container.
Add a hyperlink to jenkins index html which will load your reporter. Now reboot tomcat and go from there.
Another option could be to take a look at Cronitor (https://cronitor.io). It basically boils down to being a tracking beacon that uses http requests to ping when a cron job/scheduled task starts and ends.
You'll be notified if your job doesn't run on schedule, or if it runs for too long/too short, etc. You can also configure it to send alerts to you via email, sms, but also Slack, Hipchat, Pagerduty and others.

Resources