title: How do I setup a cron job a script that is part of a zend framework project
body: <p>I have a zendframework project for which i need to run a script periodically to upload the content of a folder and another do download. The script itself is ready but I am struggling to figure out where or how to set up the script to run. I have tried lynx and curl so far. I first had an error about specified controller being wrong and i fixed that but now I just get a blank screen when I run the script but file(s) are not uploaded.</p>
  
  <p>For a zendframework project how do I setup script to be run by cron?</p>
  
  <p><strong>EDIT:</strong>
  My project structure looks like this:</p>
  
  <pre><code>mydomain.com
  
      application
      library
      logs
      public
          index.php
      scripts
          cronjob.php
      tests
  </code></pre>
  
  <p>cronjob.php is the script i need to run. The first few lines of which are:</p>
  
  <pre><code>&lt;?php
  define("_CRONJOB_",true);
  require('/var/www/remotedomain.info/public/index.php');
  </code></pre>
  
  <p>I also modified my index.php file like below:</p>
  
  <pre><code>// Create application, bootstrap, and run
  $application = new Zend_Application(
      APPLICATION_ENV,
      APPLICATION_PATH . '/configs/application.ini'
  );
  $application-&gt;bootstrap();
  
  /** Cronjobs don't need all the extra's **/
  if(!defined('_CRONJOB_') || _CRONJOB_ == false)
  {
      $application-&gt;bootstrap()-&gt;run();
  }
  </code></pre>
  
  <p>However now when i now try to run the script, I get the message: </p>
  
  <pre><code>Message: Invalid controller specified (scripts).
  </code></pre>
  
  <p>Does it mean that I need to create a controller for the purpose? But the script folder is outside the application folder. How do i fix this?</p>