I installed CiviCRM free client relations manager component version 4.0.8 into Joomla 1.7.3. CiviCRM has many great features, one of which is the optional CiviMail bulk e-mail component. CiviMail needs a cron job to process all the scheduled mailings that you intend to send out to your mailinglists, but I was having a hard time getting the cron job up and running.
I struggled setting up the cronjob through my hosts cPanel following the setting up the cron job exactly. What I did:
*/5 * * * * yourLinuxUserName wget -O - -q -t 1 export WGETRC=/home/myserverusername/civicrm-wgetrc
http://www.example.org/administrator/components/com_civicrm/civicrm/bin/civimail.cronjob.php
Since I set my e-mail to get the logs, I received an error:
ERROR: You need to send a valid user name and password to execute this file
I tried to run the civimail.cronjob.php straight from the browser including the required parametres, then everything worked and the e-mails were sent. The URL to run civimail.cronjob.php from the browser:
http://www.example.org/administrator/components/com_civicrm/civicrm/bin/civimail.cronjob.php?name=myjoomlausername&pass=joomlauserspassword&key=thesecretkey
I tried to remove export WGETRC=/home/myserverusername/civicrm-wgetrc from the cron job command and replace the URL with the URL that contains the parametres. Guess what, still I'd get the error ERROR: You need to send a valid user name and password to execute this file logged.
After almost giving up hope, I came across this CiviCRM forum post.
Solution for me
Use backslash before & in the parametres string (\&), so the final result as a working cron job:
*/5 * * * * wget -O - -q -t 1 http://myurl.com/administrator/components/com_civicrm/civicrm/bin/civimail.cronjob.php?name=joomla_username\&pass=joomla_users_password\&key=thesecretkey
Ps, here is a link about wget parametres.