how do I add Scheduled Jobs to Crontab/Scheduled Tasks?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Abby8002
    Junior Member
    • Aug 2014
    • 10

    how do I add Scheduled Jobs to Crontab/Scheduled Tasks?

    Hi Everyone, This may be a very simple thing to do, but I need more detail/instructions. I didn't find a post for this information already on the forum. Apologies if it exists and I've missed it.

    At the end of the installation, there is instruction to:

    Add this line to the crontab file to run Espo Scheduled Jobs: * * * * * /usr/local/bin/php -f /home/bpilgrim1/public_html/espo/cron.php > /dev/null 2>&1

    Problem is, I have no idea how to do this at all. Can someone help me out by providing some step by step instructions? for example what file I need to alter? I looked for a file called "crontab", but a file with this name doesn't seem to exist.

    Thanks in advance to anyone that can assist a newbie.

    B.
    Last edited by Abby8002; 10-22-2014, 03:28 PM.
  • alasdaircr
    Active Community Member
    • Aug 2014
    • 525

    #2
    Instructions for a linux based server:

    run
    Code:
    ps aux | grep \[a\]pache
    look for the user names listed in the first column, all likelihood it's something like 'www-data'

    presuming it was www-data, run
    Code:
    sudo crontab -u www-data -e
    paste the line into the bottom of the text file, save and exit

    you should see
    Code:
    installed new crontab
    , this means it's worked.

    Comment

    • Abby8002
      Junior Member
      • Aug 2014
      • 10

      #3
      Thanks so much for the response, alasdaircr. I'm accessing my Linux hosting account via SSH using PuTTy to access Shell. When I login and enter ps aux | grep \[a\]pache Nothing is returned at all. So I entered sudo crontab -u www-data -e and received the following:

      "-bash: sudo: command not found"

      Since nothing was returned on the first command (and no errors were either), I didn't get to see any usernames or columns or anything, so unsure if www-data is correct either.

      Any thoughts?

      Comment

      • alasdaircr
        Active Community Member
        • Aug 2014
        • 525

        #4
        What user account do you login as?

        root?

        Comment

        • Abby8002
          Junior Member
          • Aug 2014
          • 10

          #5
          I was using my cPanel login, not root. I think I've got the crontab file updated. I took a screenshot and posted it at http://www.bizarrb.com/crontab.jpg (for some reason getting an error when trying to upload to this post). I was able to add the line to Cpanel Cron Jobs. I logged into my hosting with SSH using my CPanel username and password, not root. I entered command crontab -e and the line for the job is showing as in the screenshot at that url I've provided.

          Any other help you can provide is appreciated.

          Cron jobs are brand new to me....so is shell access/SSH. Thanks for everything.

          Comment

          • alasdaircr
            Active Community Member
            • Aug 2014
            • 525

            #6
            That's you nearly there, congrats

            Only thing is the job is set to run on the hour, once an hour.

            You want it to run every minute

            Replace the first zero with an asterisk and you're done

            Comment

            • alasdaircr
              Active Community Member
              • Aug 2014
              • 525

              #7
              By the way, uninstall bitvise, and install Putty instead.. you'll never have to pay for it.



              You want putty.exe

              Comment

              • Abby8002
                Junior Member
                • Aug 2014
                • 10

                #8
                Thanks again for everything. So I've got it set to every minute now, but when I look at the scheduled job in Espo it shows failed for each minute, but no other details on what the failure is all about. I've got the inbound email set up to create a case for the inbound email, but no cases have been created. Outbound email is working fine, just inbound seems to be a problem. I've posted screen shots of the scheduled job and the inbound email at these links:




                Where am I going wrong?

                I tried PuTTY, but had some difficulty using it, I will try it when I need to access shell again. Thanks so much!

                Comment

                • alasdaircr
                  Active Community Member
                  • Aug 2014
                  • 525

                  #9
                  First thing is lower the freq

                  Comment

                  • alasdaircr
                    Active Community Member
                    • Aug 2014
                    • 525

                    #10
                    First thing is set the 'Scheduling (Crontab notation)' to the default as you shouldn't need to check every minute (and some providers would block you for this).

                    the default is
                    Code:
                    */10 * * * *
                    I think.

                    Enable debug logging in Espo (edit data/config.php). But be aware that Espo might not be logging everything that is related to this.

                    When you add the Inbound email account, are you able to see the list of folders when you click the Up arrow beside 'Monitored Folders'?

                    If not, then you could either have wrong password, wrong port, wrong security, missing PHP-Imap modules on the server.

                    Comment

                    • shalaka
                      Junior Member
                      • Oct 2014
                      • 2

                      #11
                      How can I run the cron job on my windows server application.

                      Comment

                      • alasdaircr
                        Active Community Member
                        • Aug 2014
                        • 525

                        #12
                        Originally posted by shalaka
                        How can I run the cron job on my windows server application.
                        Posting on someone else's thread is considered bad etiquette. Also, we're not Google.

                        Comment

                        • Abby8002
                          Junior Member
                          • Aug 2014
                          • 10

                          #13
                          Hi, Thanks so much. I enabled logging, and was receiving the following:
                          [2014-10-29 19:24:01] Espo.ERROR: Failed job running, job [54513ed13a603]. Error Details: No trash folder 'INBOX.Trash' found for Inbound Email 544859bc8e76d [] []

                          I changed the email account to an account on a different domain and it's working now, so isolated to my other email address somehow. Unsure why the folder cannot be found, I selected it by clicking the up arrow, and located it that way.

                          Anyways, all good now.

                          Thank you!

                          Comment

                          • alasdaircr
                            Active Community Member
                            • Aug 2014
                            • 525

                            #14
                            Great work

                            Comment

                            Working...