Magneto Newsletter mails are not going - magento

I am having Magento 1.9.3 and i am new to Magento.
My newsletter subscription is not working. I have checked all things in magento configuration. Seems its the trouble with cron on server. But with out knowing i do not want to make changes on server. I am using A2 hosting provider, and there is a cron set like this, which runs for every 30 mins.
/bin/cagefs_enter.proxied php /home/lasakico/public_html/cron.php 1>/dev/null 2>/dev/null
I am not sure what is the problem, either its the problem with cron or magento.
I have checked magento configuration->Advanced->System->Cron, where values are stored for Generate Schedules Every : 15. and rest are like 20, 15, 10, 60,600
Please let me know if anything is not clear in the question. I will ans them.

Magento has a script called cron.php which handles all of the timed jobs that your Magento store has to do. In this list is the task of sending out newsletters. You have to set up your server crontab to run this cron.php script at regular intervals (eg 5 minutes).
Once you do this, you should find that your newsletter will be sent out as expected
Open up an SSH session with your server. (If you can’t do this you
are going to have to ask your hosts to do this for you instead).
Browse to the document root of your magento store, the folder with
cron.php in there
enter the command
pwd This command gives you the current full path. Write this down
somewhere
enter the command
which php
This command gives you the path to your PHP binary. Write this down somewhere
enter the command
crontab -e
This opens up your crontab editor which is the system for scheduling
tasks on Linux
hit the [i] key to go into insert mode on the crontab editor (vi
basically)
on a new line paste the following, but replacing the paths with the
paths you got before
*/5 * * * * /path/to/php -f /path/to/cron.php
Hit [esc] then type the command
:wq
This saves the crontab or cntrl + x and Y
Create a newsletter and schedule it to send in 2 minutes time.

Related

Cron job gets file from server, what should I add to the script to have it check again in 15mins if the file is unchanged?

This Crontab Day of the Week syntax does not provide a solution.
I have a cron job set; using wget to download a file & generate a report.
What should I do to amend the script so that if the file on the server hasn't been updated yet, it tries the job again after 15 minutes?

Mail not sent automatically with cron

I am facing a problem with custom email. Email does not sent automatically according to its schedule.
Cron is working fine. I have debug code using Mage::log(). I am getting each log before sendTransactional function after that log is not working.
However its working fine with Aoe_schedule when I execute cron forcefully.
But Its not working automatically..
So the code is correct. Problem is with automatic cron execution.
You can create a crontab file
in server cmd
crontab -e
in open window
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=your email for error message
*/5 * * * * full path to your site cron.sh file(example: /home/username/www/public_html/cron.sh)
this is will execute your cron.sh every 5 minutes and Aoe_Sheduler dosen't write a warning about heartbeat

Magento Cron not working: no heartbeat task

I noticed the cron jobs not working because some tasks were not performed (automatic feed generation, google sitemap, ...).
1) I installed the (very useful) AOE scheduler
2) I've checked cron_schedule SQL table via PHPmyAdmin: no task is generated, but if I press Generate schedule in AOE scheduler, a list of task is generated. All tasks remain in pending status (executed at NULL).
3) I've set (crontab -e)
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /home/fpl/webapps/magento/cron.sh
I've tried to run cron.sh manually via SSH. When I run manually the sh the heartbeat task is run. So I'm also sure the problem is not in the cron.sh script.
Cron is properly running on the server.
Configuration
Webfaction hosting
Magento ver. 1.8.0.0
Cron schedule Configuration on magento admin panel
Generate Schedules Every 1
Schedule Ahead for 20
Missed if Not Run Within 15
Heartbeat task schedule (cron syntax) 0,5,10,15,20,25,30,35,40,45,50,55 * * * *
Thanks for your help!
my guess is that your cron.sh is not executable and that's why nothing is happening.
Please check the file persmission and add the executable flag
chmod +x /home/fpl/webapps/magento/cron.sh
You might also want to check your server's log files for cron (e.g. https://askubuntu.com/questions/56683/where-is-the-cron-crontab-log)
Instead of relying on the fact that cron is executable you could also run it like this
/bin/bash /home/fpl/webapps/magento/cron.sh
And: instead of writing down the minutes like that you should be using this:
*/5 * * * * /bin/bash /home/fpl/webapps/magento/cron.sh
Did you check the status for crontab?
service crond status // depends on your OS
If its not running, start it
service crond start
And configure for system startup
chkconfig crond on
HTH
Good luck!
edit cron.sh and change line 39 to:
PHP_BIN=`/usr/local/bin/php56`
It tries to use which php but that isn't so great on webfaction servers as there are lots of php versions.
Adding
crontab -e */5 * * * * /usr/bin/wget -O /dev/null -q http://www.partsfortreadmill.com/cron.php
and setting a proper cron.php in the above path

shell script as cron job

Several people have had this problem, but none of the fixes mentioned around the net have worked for me.
I have a simple shell script that copies log files from a few directories, and puts them in one single directory on a remote machine. The script works fine.
I then create a cronjob, which doesnt seem to execute. My crontab looks like:
1 * * * * /bin/bash /home/user/myscripts/getlogs.sh > /tmp/cronscript.out 2>&1
/var/log/cron shows this every minute
Aug 20 17:02:01 hostname crond[2614]: (root) RELOAD (/var/spool/cron/root)
so it cron job executes, but it doesnt seem to run the shell script.

Amazon auto start Server via cronjob

I have created a cron job to start and stop instance at particular times.
I have set up amazon APIs against user ubuntu. saved script start.sh in home folder
#!/bin/bash
ec2-start-instances i-instanceID
I placed the job in cron tab.
0 18 * * 5 /home/ubuntu/scripts/dev/stop.sh
The script is exicuiting on specific times but the instances are not stopping/starting.
Can anyone suggest a way out.
I also tried setting up the same job in root user that also failed
You need to define which binary is executing the script. Hence, try with this:
0 18 * * 5 /bin/bash /home/ubuntu/scripts/dev/stop.sh
^^^^^^^^^

Resources