Search

I haven’t looked at it for some time. Anything in particular you’re needing? or isn’t working?

Hey Alistair, I just noticed your TO DO item in the README file on github.

[TO DO]

 - Have way to trigger tasks without using cron (Poor mans cron)

I was just wondering if there was any movement on that TO DO.

That’s it. Thanks for everything man!

I’m having a hard time getting this work on an Ubuntu server.

I’m opening up crontab -e, and editing the file. I’ve added the following…

# m h  dom mon dow   command
 10 *    *   *   *   symphony -t tokenhere cron run-tasks
#

NOTE: I replace my actual token with “tokenhere” in the code example above

I tried running symphony -t tokenhere cron run-tasks in my terminal, and I get back…

symphony: command not found.

Can anyone point me in the right direction.

Also, here’s a screenshot of the Cron screen in Symphony alt text

The Symphony cron command is listed as http://brianzerangue.local/symphony/extension/xmlimporter/importers/ministrygroupsimport/?auth-token=tokenhere

NOTE: tokenhere listed in this code is just there for this example, it normally has auth-token assigned by Symphony when you check your Author to have remote login with token selected (which I do)

For those of you who have this extension working, would you mind giving me some pointers on how to get this to work? My experience with the extension so far is listed in the comment above.

How would I run a command for the XML importer? What command would use to run that in Cron?

EDIT: I MOVED THIS COMMENT TO ITS OWN THREAD.

Got it!!!!!

NOTE: I watched this helpful video on how Drupal uses Cron. Actually, the first half of this video, shows you how to setup Cron on your Mac or Linux machine (Windows developers, here’s a helpful tutorial on how to setup wget for Windows on your machines). The Drupal specific stuff on the back half of the video you can ignore.

Setting up Cron to run XML Importer

Step 1) Install the following extensions, XML Importer, Shell, Cron

Step 2) Setup your XML import through XML Importer.

Step 3) Edit crontab by going to your Terminal and run crontab -e

10 *    *   *   *   php /home/username/Sites/test.com/extensions/shell/bin/symphony -t 156e87f2 cron run-tasks

Step 4) In Symphony, go to the Cron menu option under System, click create new, to create new cron job on Symphony.

In the command line field in Cron, use the following, if curl is installed…

curl --silent --compressed http://test.com/symphony/extension/xmlimporter/importers/run/testimport/?auth-token=156e87f2

OR if wget is installed

wget -O - -q -t 1 http://test.com/symphony/extension/xmlimporter/importers/run/testimport/?auth-token=156e87f2

Then wait and see if it works. Or you can force it by going to your terminal, and typing in and your command from the crontab

php /home/username/Sites/test.com/extensions/shell/bin/symphony -t 156e87f2 cron run-tasks
$driver = Shell::instance()->ExtensionManager->create('cron');

The above line was causing an error in v2.2.2. I removed the line and required the class files, below, into the file instead.

requireonce(EXTENSIONS . '/cron/lib/class.crontask.php');
requireonce(EXTENSIONS . '/cron/lib/class.crontaskiterator.php'

The $driver will be required for some reason, so try

$driver = Symphony::ExtensionManager()->create('cron');

This is the correct syntax for 2.2.2

Thanks designermonkey.

I'll test it out tomorrow and confirm it works.

Fatal Error: No suitable engine object found

An error occurred in /var/www/vhosts/holiday.local/httpdocs/symphony/lib/core/class.symphony.php around line 157
152:                return Administration::instance();
153:            }
154:            else if(class_exists('Frontend')) {
155:                return Frontend::instance();
156:            }
157:            else throw new Exception(__('No suitable engine object found'));
158:        }
159: 
160:        /**
161:         * Accessor for the current Configuration instance. This contains


Backtrace
===========================
[/var/www/vhosts/holiday.local/httpdocs/symphony/lib/toolkit/class.extensionmanager.php:624] Symphony::Engine();
[/var/www/vhosts/holiday.local/httpdocs/extensions/cron/bin/run-tasks:18] ExtensionManager->create();
[/var/www/vhosts/holiday.local/httpdocs/extensions/shell/bin/symphony:145] RunTasks->run();


Database Query Log
===========================
SET character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8'; [0.0002]
SET CHARACTER SET 'utf8'; [0.0001]
S    ELECT SQL_CACHE `session_data` FROM `sym_sessions` WHERE `session` = '365jeh1fbb7mu3slqap8d2g9q5' LIMIT 1; [0.0002]
SELECT SQL_CACHE `name` FROM `sym_extensions` WHERE `status` = 'enabled'; [0.0001]
SELECT SQL_CACHE `id`, `username`, `password` FROM `sym_authors` WHERE SUBSTR(SHA1(CONCAT(`username`, `password`)), 1, 8) = 'a39880be' AND `auth_token_active` = 'yes' LIMIT 1; [0.0004]
SELECT SQL_CACHE * FROM `sym_authors` WHERE `id` IN (1) ORDER BY id ASC; [0.0002]
UPDATE sym_authors SET  `last_seen` = '2011-08-15 08:38:45' WHERE  `id` = ''; [0.0002]

Sorry, it didn't work! I tried looking where the $driver comes into it but couldn't find anything in Shell either. It is failing in the Engine() function of class.symphony.php.

public static function Engine() {
            if(class_exists('Administration')) {
                return Administration::instance();
            }
            else if(class_exists('Frontend')) {
                return Frontend::instance();
            }
            else throw new Exception(__('No suitable engine object found'));
        }

So it works when you do it the way you tried?

I've looked into this and it confuses the hell out of me. I don't understand where the ShellCommand class is or where Shell is being created.

I'm going to badger the core devs to look at this too. I've forked it to the Symphonists organisation so it can be maintained for the future, but I need an understanding of how it works first.

Stick with what works for now...

I don't understand where the ShellCommand class is or where Shell is being created.

This is from the Shell extension. You create a command file in a bin folder within your extension so that the Shell extension can find and execute it.

Sorry for late reply.

It doesn't seem the '$driver' is being used elsewhere in the Shell and Cron extensions. That's right, the fix I had posted works:

requireonce(EXTENSIONS . '/cron/lib/class.crontask.php');
requireonce(EXTENSIONS . '/cron/lib/class.crontaskiterator.php'

Because once this line is removed:

$driver = Shell::instance()->ExtensionManager->create('cron');

The only error thrown is that the class CronTaskIterator is not found - it is being initiated in the next line.

$iterator = new CronTaskIterator(MANIFEST . '/cron');

Can someone explain what purpose the driver has? It has being working for the past few days with my fix. I haven't come across any problems with it at all...

Cheers for your help guys.

Does anyone have Cron working in 2.3 or have people dropped this approach in favour of CLI and shell extension or something?

@moonoo2 Did you give this a try and get it running in Symphony 2.3? It doesn't look like it's been touched in a while but it does look pretty useful.

Havent looked at it in a while to be honest.. I used a third party service for running cron jobs in the end.. more of a speed in time for live deployment of site really.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details