Node js and system cron jobs - node.js

I am using node-cron to schedule some tasks inside my node app. This package has some API to create, start and stop cron jobs. However, I can't seem to find these cron jobs when I run crontab -l command in my OS terminal. I tried both on my mac os as well as on centos.
Specific question:
Does such node packages create cron jobs at the OS level?
If answer to 1 is yes, then will these cron jobs execute irregardless my node app is running or not?
If answer to 2 is yes, then how do I stop and clear out all such schedules cron jobs?

Giving a fast look at the node-cron source code, you can check that,
node-cron does not create any cron at the OS Level.
It looks like just a long time out functionality..
I suppose that if the node process will be restarted you lost the launched cronjobs.

Related

Monitoring a cron running on HPCC cluster

I have a cron scheduled to run on Thor cluster. Is there a way to monitor a cron running on HPCC Cluster and send a notification if the cron is not running due to a failure or system shutdown?
Akhilesh,
The only way I can think of to do that would be to make the CRON job periodically send a "ping" of some sort (an email, or update a semaphore file, or ... ) then have a separate process running on another box to alert someone if that "ping" doesn't arrive as scheduled (indicating the CRON job is no longer working).
HTH,
Richard

Cron job does not trigger Airflow DAG externally

I am quite new to Airflow. However, I bumped into the same timing and interval issues that novice faced when dealing with the schedule interval. As such I wanted to try to externally trigger a DAG via cli. This can be done by simply going to the console and typing example:
airflow trigger_dag tutorial
(using airflow docker image: 1.10.9)
Next I wanted to see if the same command works with a regular cron job as I wanted to trigger it as like a cron job time. Hence I created a cron job of something like this:
* * * * * airflow trigger_dag tutorial
However this does not trigger the DAG now.
Upon other few experiments, I can manually trigger the DAG via the same command in an shell script, but it cannot be done with a sh command via the cron job.
(I have verified that the cron works as I tried with just outputing a normal file.)
Can anybody tell me how I can trigger the DAG with a regular cron job?
Or what went wrong here?
Most likely you have some environment variable in your user's profile - possibly also .bash_profile or .bashrc that are not available in cron. Cron does not "source" any of the user profile files - you need to source them manually if you want to set them, before running the script.
Nice article that also shows you how to debug it is here: https://www.ibm.com/support/pages/cron-environment-and-cron-job-failures
Try to update the cron command with full path to Airflow. To get installation path you can execute:
which airflow
Now update the cron command.

How long before a process automatically dies by itself

I am trying to optimize the time how many times my cron job runs to create a python script.
I want to know how can I find or know before a process dies by itself so that way I can run my cron job accordingly
Trying to setup the time schedule of my cron job to run a python script on linux server
no code

Schedule Dockerized Import Job in Azure

I have a cron running hourly inside a docker container (swarm) in Microsoft Azure.
The container is currently running all the time, and the (unix) cron keeps triggering the import script.
I would be interested if there is an elegant way of scheduling job. e.g using the https://learn.microsoft.com/en-us/azure/scheduler/
Say the scheduler spins up the container (starting the import script) and ending when done. It would handle execution intervals, failed jobs etc.
Any thoughts?
Cheers,
Tibor

How can I read the PBS launch script of a job that is running?

I am using /torque/4.2.5 to schedule my jobs and I need to find a way to make a copy of my PBS launching script that I used for jobs that are currently queueing or running. The plan is to make a copy of that launch script in the output folder.
TORQUE has a job logging feature that can be configured to record job scripts used at launch time.
EDIT: if you have administrator privileges and want to read the file that is stored you can inspect TORQUE_HOME/server_priv/jobid.SC
TORQUE_HOME is usually /var/spool/torque but is configurable.

Resources