I'm trying to run quick php update over cron tab on Cloud9 IDE.
Here is my crontab -l:
*/2 * * * * php /home/ubuntu/workspace/public_html/updater.php
I also tried to use data from "whereis php" instead of simple php, but still nothing.
And here comes my question. Is there any time restriction eg. 1 hour minimum for cron in C9?
Or maybe I'm doing something wrong.
Tried to restart cron already.
Cron daemon is not started. You have to start it manually. Your output from px -aef | grep cron shows that grep is running not cron.
sudo cron start
Please read here, from the C9 FAQ:
We currently do not support cron jobs within Cloud9 workspaces. The way to proceed would be to get a Cloud9 premium plan which allows you to create SSH workspaces
You may need to run the cron daemon to make the cron job run ("service cron start"). However Cloud9 workspaces are paused when they are inactive so it will only run when you're actively logged into the IDE.
Related
I have created a cron job and its only working when I run the below command:
php bin/magento cron:run
But the cron should run automatically. What Could be the issue and why the cron is not running automatically in my case?
Could anyone please help me and guide on this?
Cronjobs in Magento are separate from the cronjobs ran on the server. A cronjob in Magento can't run without a cronjob on the server.
If you want cronjobs in Magento to run automatically you'll have to add a cronjob on the server.
* * * * * bin/magento cron:run
I do not recommend copy-pasting the above as a cronjob on your server, it does for example not log any output.
If you want a more detailed explanation about the workings of cronjobs in Magento I recommend the article in Magento DevDocs below.
https://devdocs.magento.com/guides/v2.4/config-guide/cli/config-cli-subcommands-cron.html
I have a requirement of running a node script (not app or dapp), which has no front -end files (html, css). This script will send transactions (call smart contract function) in regular intervals. the only constraint is that this script needs to run perpetually (forever) without stopping, unless a specific command is given by admin. Please do suggest how we could achieve this? Thanks.
PS: in case you have a better platform suggestion other than heroku, those are welcome as well with details. Tx.
Unix cron works fine for this kind of things. Just add a cron in your crontab with command :
crontab -e
Then just set your pattern and add a line with your command to launch, for example this will run each day at 3.00 AM:
0 3 * * * /root/backup.sh
Then don't forget to reload your cron process:
sudo service cron restart
Define your pattern here : https://crontab.guru/
You can have a look at kue.
The good thing about kue is, that it gives you a UI where an admin can view the running, failed, jobs etc. Also, you can configure it to stop a job programmatically.
I have to run NodeJS application which has to run uninterruptedly, but I need to stop it and restart it every 10 minutes.
I'm Working on a dedicated Ubuntu 18.04 machine.
I have read something about cron but I don't know well how it works. Does it stop the command that was run with it?
You can use forever to run the application, and set up a cron job to restart it in forever every five minutes. As a bonus, forever will also restart it for you if it fails in between cron job executions.
In my knowledge, the cron doesn't stop the command that had run before, but you could add the logic to do that check in your application.
Here you can find an article that shows some solutions to prevent duplicate cron job executions.
I'm running my small node app on an Ubuntu server, I can use a simple Upstart script to automatically start the node server on server launch.
However, I'd like the node app to run at particular times of day -- what are my options for implementing this?
Is it best to do this within the Node app or from the Ubuntu environment?
What about cron?
$ crontab -e
# in the editor that opens:
0 */2 * * * ~/path/to/your/node/script.js > /tmp/out.log 2> /tmp/err.log
That will run your script.js every 2 hours, ie 0:00 (midnight), 2:00, 4:00, etc. It also logs to your /tmp directory, but that's entirely optional.
In Magento I have set the cron job to run every minute and I also created a cron job in the plesk control panel because the magento setup wasn't working for me.
So I created a cron job as follows:
/usr/bin/php -f /home/dealscou/public_html/cron.php
This works for me most of the time when the cron job is set to 1 minute.
If I create a cron job for any other amount of time, it does not work.
I am really stuck on this and my customer is getting ticked that I can't fix it.
Any help would be appreciated.
Kathy
You should run the cron from the cron.sh file and not directly from the cron.php file