We have Azure Azcopy configured on Ubuntu Server (16.04). The ini file we have created pulls data from a cloud storage account to the local Ubuntu system. When we run it manually, there are no issues.
However, we want to run it via a cron job every thirty minutes.
Here are the steps we have taken (we've tried variants from stack flow postings as well). Cron is running.
crontab -e
30 * * * * root /azcopy/azcopy --config-file "azcopy_run.ini"
crontab -l lists it fine
no errors in logging
Any guidance please?
Thanks
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 an ansible playbook in yaml to start a service in a host server.
can I schedule it to run at a certain time everyday?
Also will cron work for it?
ansible-playbook is a command, like cp or any other.
So yes, you can add it as cron job and set desired schedule for it.
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.
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