+ Start a Discussion

Email to case: How to set up Cron job to keep EmailAgent running on Apache?

I'd really appreciate some help on the final steps of getting the email agent to work for me.

I have set up a VPS (virtual private server) with Westhost on an Apache sever. (I know nothing about Java and Unix BTW!)

I have installed the EmailAgent on the server and configured it correctly. If I log in using Putty (a SSH client), change to the EmailAgent directory in the root and then execute the command

java -jar /EmailAgent/Email2Case.jar /EmailAgent/sfdcConfig.txt /EmailAgent/log4j.properties

then everything works beautifully, it moves emails, drops attachments onto the server and every couple of minutes, check for new emails.

However as soon as I close the PUTTY session, the Java application stops and emails are not processed.

I have tried putting the above command into a Cron jab (and I know it's being executed) but the EmailAgent app does not run.

What am I doing wrong. Is there a better way of setting this up? Any assistance would be much appreciated.

The actual entry in my Cron job is:

*/2 * * * * "java -jar /EmailAgent/Email2Case.jar /EmailAgent/sfdcConfig.txt /EmailAgent/log4j.properties" /dev/null
Hi Ian,

for me the linux "screen"-program works fine. If you close the ssh session, the "screen" command prompt is still alive.
Here you find more about "screen":

Regards elbe15