Jump to content


Photo

Setting up Email Archiving on Windows Azure-based Zurmo

azure email archiving cronjob bitnami

  • Please log in to reply
16 replies to this topic

#1 Woody

Woody

    Member

  • New Members
  • PipPip
  • 13 posts

Posted 08 March 2013 - 07:49 AM

I'm a little under-experienced to be dealing with this but hope you guys can give me some advice. I've managed to get Zurmo running on Windows Azure through a Bitnami installation. I'd like to also activate the email archiver, but I'm finding the instructions at http://zurmo.org/wiki/email-archiving very hard to follow.

 

It asks that I set up a cronjob to automate the checking of the imap account, but it seems that this is not possible on a Windows Azure VM. Is there any other way to set up this automated task?

 

Can I also just say Zurmo so far has been fantastic, and I'm quite excited about it. For us, it hits the perfect spot between the under-powered but handsome Highrise and messy feature pimps such as SugarCRM.



#2 raysto

raysto

    Zurmo Team

  • Administrators
  • 1,973 posts

Posted 08 March 2013 - 03:37 PM

Not too familiar with Windows Azure VM. If it will not allow you to automate the checking of the imap account, then that might be a problem. We have Developer Sessions every Tuesday at 10:00AM Chicago Time (http://zurmo.org/for....php?/calendar/). You can always join an upcoming session and ask our technical team about another way to set up that automated task. Also, we can provide you a hosted trial instance for testing (http://zurmo.org/free-trial).

Thank you for the kind words. We are here to disrupt the open source CRM space so I'm glad you appreciate what we are building. Highrise is handsome and Sugar is messy, so our objective is to keep Zurmo handsome/pretty and still bring the rich feature set as other enterprise class CRMs.


Ray Stoeckicht
Zurmo Team
Try Zurmo Pro


#3 m42

m42

    Member

  • New Members
  • PipPip
  • 18 posts
  • LocationPortugal

Posted 08 March 2013 - 09:06 PM

Hi Woody, 

 

I don't know Windows Azure VM's but maybe you can create a scheduled task to run the "zurmoc" command and run the Email Archiving Job from there... 

 

Something like:

 

<Path_to_php> zurmoc.php jobmanager <username> EmailArchiving 



#4 Woody

Woody

    Member

  • New Members
  • PipPip
  • 13 posts

Posted 11 March 2013 - 02:55 PM

Okay thanks for the tips guys. We'll take a look at it and report back.



#5 Woody

Woody

    Member

  • New Members
  • PipPip
  • 13 posts

Posted 12 March 2013 - 04:27 AM

I've had our tech guys on with this for some time and not had much progress (it makes it more difficult that they can only read Chinese - we're based in China). If we went with a installation of Zurmo on Amazon Web Services, a Linux-based system, would a Bitnami installation set up the cronjob required for email archiving automatically?



#6 raysto

raysto

    Zurmo Team

  • Administrators
  • 1,973 posts

Posted 12 March 2013 - 01:38 PM

I would like to think so, since AWS is Linux based and should resolve any Windows issues. I have still seen some challenges getting email archiving set up on certain Linux installations. Will you be hosting your own email server that will handle IMAP?

Besides installation, there is still setup to make email archiving work: http://zurmo.org/wiki/email-archiving. We can set you up with a hosted trial for testing purposes if that helps: http://zurmo.org/free-trial


Ray Stoeckicht
Zurmo Team
Try Zurmo Pro


#7 Woody

Woody

    Member

  • New Members
  • PipPip
  • 13 posts

Posted 13 March 2013 - 11:30 AM

Okay, thanks for all the tips guys. I've finally made some headway and think I am almost there.

 

We went with a Bitnami installation on AWS's EC2, through Bitnami's Cloud Hosting solution. After connecting to the virtual machine through the AWS built-in SSH client, I can run the Email Archiving job independently with the following command:

 

cd /opt/bitnami/apps/zurmo/htdocs/app/protected/commands; ./zurmoc jobmanager <zurmo username> EmailArchiving

 

That ran successfully and pulled in our emails from the Zurmo Dropbox email account we set up. Going to job manager shows it as having ran successfully too.

 

However, I can't get the crontab to run the job automatically. Using the 'sudo crontab -e' command for the first time, I was presented with four options, I chose option [2] ('nano') and added the following commands:

 

5,10,15,20,25,30,35,40,45,50,55 * * * * cd /opt/bitnami/apps/zurmo/htdocs/app/protected/commands; ./zurmoc jobmanager <zurmo username> Manager > /dev/null 2>&1

1,2,3...58,59 * * * * cd /opt/bitnami/apps/zurmo/htdocs/app/protected/commands; ./zurmoc jobmanager <zurmo username> EmailArchiving > /dev/null 2>&1

 

After that wasn't working, I tried a few modifications, but now every time I run 'sudo crontab -e', it doesn't give me the original four options and takes me directly to the crontab. Anyway, none of the slight modifications have worked (i.e. I tried removing the '/dev/null 2>&1').

 

I've ran a few tests such as 'sudo status cron' and cron is running. And I tried restarting cron 'sudo restart cron' after modifications and that hasn't helped either. 'grep cron /var/log/syslog'doesn't show any tasks running.

 

So I'm thinking I'm probably editing the wrong crontab. I'm saving the edited crontab to: /tmp/crontab.XLEFwR/crontab. Should it be going somewhere else?

 

Any further advice would be greatly appreciated!

 

In answer to your question raysto, our IMAP is hosted with just our web hoster. Thanks for pointing out the free hosted trial, but we are looking for something more permanent. The Zurmo pricing once the trial finishes are a little prohibitive for us too.

 

Thanks!

 

 



#8 m42

m42

    Member

  • New Members
  • PipPip
  • 18 posts
  • LocationPortugal

Posted 13 March 2013 - 12:45 PM

Hi woody, 

 

I wouldn't worry much with the crontab filename, crontab usually picks the filename ant integrates it into the proper contrab for the user.. 

About the commands, you could try yhe following: 

- instead of writing all the minute values, you could use some shortcut like: */5 for the first command ou simply * for the second row.

- instead of writing the command in two parts, simply invoke the zurmoc with the full path, like so: /opt/bitnami/apps/zurmo/htdocs/app/protected/commands/zurmoc jobmanager <zurmo username> EmailArchiving

 

HTH...



#9 Woody

Woody

    Member

  • New Members
  • PipPip
  • 13 posts

Posted 13 March 2013 - 04:58 PM

Great, thanks for the pointers, I've modified the commands, making things a lot neater.

However, still no luck getting the jobs to run.

I understand it shouldn't matter where the crontab is saved, but just to clarify where the command is being run from - I'm running the 'crontab -e' command from the root directory of the EC2 server.

I've included a screen shot of my latest crontab status check ('grep cron /var/log/syslog'), and at the bottom you can see the latest crontab commands I have added (from 'crontab -l')

 

Anything else I may be doing wrong?

 

Screen Shot 2013-03-14 at 00.46.28.png



#10 m42

m42

    Member

  • New Members
  • PipPip
  • 18 posts
  • LocationPortugal

Posted 13 March 2013 - 05:52 PM

Aha ! I guess it lacks the "root" user on the zurmoc commands, like so:

 

*/5 * * * * root /opt/bitnami/apps/zurmo/htdocs/app/protected/commands/zurmoc jobmanager woody Manager

 

HTH,

Pedro "m42" Ribeiro



#11 Woody

Woody

    Member

  • New Members
  • PipPip
  • 13 posts

Posted 14 March 2013 - 01:21 AM

Thanks again Pedro. I added the root user to both commands, and restarted the crontab 'sudo restart cron', but still no activity. I also tried users 'bitnami' and 'woody' (restarting cron after both) and neither of them worked neither.

 

Are there any other diagnostics I can use to find out why on earth my crontab is not running?

 

Cheers



#12 m42

m42

    Member

  • New Members
  • PipPip
  • 18 posts
  • LocationPortugal

Posted 14 March 2013 - 10:32 AM

hmm.. maybe its an environment problem... you'll have to check if the path to php is defined on your cron environment...

 

usually cron defines a very simple environment, most of the variables defined in your login shell aren't available to cron, which might prevent the execution of the php interpreter. Check where is your php with

whereis php

 

and the check that the path given matches some of the dirs on the "PATH = " line on crontab.

 

If doesn't match, just add the found path to the crontab line, e.g., if "whereis php" gives you something like:


/opt/php5.3.18/

 

 

you should add that path to the crontab, like so:



PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/php5.3.18

 

 

 

 

 

I hope all makes sense :)

 

Pedro "m42" Ribeiro



#13 Woody

Woody

    Member

  • New Members
  • PipPip
  • 13 posts

Posted 14 March 2013 - 12:16 PM

Pedro, you're a legend, the instructions are very easy to follow. I'll be a programmer in no time.

 

Unfortunately my php seems to have left my server. Any idea on how to get it back?

 

Running the whereis php command returns this - 'php:                     '

 

See my attached image.

 

Screen Shot 2013-03-14 at 20.15.52.png

 

Seen as I haven't messed around with any of the settings other than that mentioned here, do you think that this is an issue with the Bitnami installation or the EC2 server instance itself? And sorry if this had turned a little off-topic and more into a troubleshooting session.



#14 m42

m42

    Member

  • New Members
  • PipPip
  • 18 posts
  • LocationPortugal

Posted 14 March 2013 - 02:26 PM

Woody, thank for you kind words...

Since the zurmoc command runs if launched from the command line, i guess its the "whereis" database that's not up to date. That's ok. You can try one more thing, on your shell, just run:

echo $PATH

 

and compare it with the information on the crontab. Adjust if needed (see my previous post) and try to run it...

 

Pedro "m42" Ribeiro



#15 Woody

Woody

    Member

  • New Members
  • PipPip
  • 13 posts

Posted 14 March 2013 - 04:25 PM

The path shown by $echo PATH was rather long, as follows:

 

 

/opt/bitnami/rvm/bin:/opt/bitnami/memcached/bin:/opt/bitnami/varnish/bin:/opt/bitnami/redis/bin:/opt/bitnami/nodejs/bin:/opt/bitnami/mercurial/bin:/opt/bitnami/perl/bin:/opt/bitnami/git/bin:/opt/bitnami/nginx/sbin:/opt/bitnami/frameworks/laravel/app/Console:/opt/bitnami/frameworks/cakephp/app/Console:/opt/bitnami/frameworks/codeigniter/bin:/opt/bitnami/frameworks/symfony/bin:/opt/bitnami/frameworks/zendframework/app/Console:/opt/bitnami/sphinx/bin:/opt/bitnami/sqlite/bin:/opt/bitnami/apps/django/bin:/opt/bitnami/php/bin::/opt/bitnami/java/bin:/opt/bitnami/mysql/bin:/opt/bitnami/postgresql/bin:/opt/bitnami/apache2/bin:/opt/bitnami/python/bin:/opt/bitnami/subversion/bin:/opt/bitnami/ruby/bin:/opt/bitnami/common/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

 

So I added that to the end of PATH specified in the crontab.

 

But still no action on Zurmo. Nor is there any notable activity in sys. Looking at the top reason for crontabs not running is the environment issue, so guessing we may be on the right track...



#16 m42

m42

    Member

  • New Members
  • PipPip
  • 18 posts
  • LocationPortugal

Posted 14 March 2013 - 11:55 PM

Wow.. thats a long path ...

 

I'm running out of options.... but you could try one more thing.. change the crontab command line to:

 

*/5 * * * * root php /opt/bitnami/apps/zurmo/htdocs/app/protected/commands/zurmoc jobmanager woody Manager

 

i,e,, instead of executing the zurmoc command as a regular shell script, invoke it as a parameter to the php interpreter...

 

If this fails, i can't think of anything else right now.. sorry...

 

Pedro "m42" Ribeiro



#17 Woody

Woody

    Member

  • New Members
  • PipPip
  • 13 posts

Posted 18 March 2013 - 06:09 AM

Thanks all for the advice and help. Unfortunately nothing would get my zurmoc cronjobs to work. In the end a friend of a friend wrote a simple shell script that ran the EmailArchiving command, then we entered the shell script into the crontab. Working fine now.

 

If anyone has any ideas on a more elegant method I would be all ears.

 

Cheers!







Also tagged with one or more of these keywords: azure, email archiving, cronjob, bitnami

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users