Cron jobs and restore

Cron jobs and restore

by Barb Hall -
Number of replies: 1

Is it possible to restore my moodle from a cron job?

Here's my cron that I run every night at midnight my time (EST)

If so, please give detailed instructions as I am not much of a techie.  I'm looking at this method because I have an error after trying to do an upgrade and it won't let me past the page with the following error message:

=====snip=====

Plugin "theme_myoldertheme" is installed in incorrect location "$CFG->dirroot/admin/tool/qeupgradehelper", expected location is "$CFG->dirroot/theme/myoldertheme"

More information about this error

Debug info: 
Error code: detectedmisplacedplugin
Stack trace:
  • line 454 of /lib/upgradelib.php: plugin_misplaced_exception thrown
  • line 1630 of /lib/upgradelib.php: call to upgrade_plugins()
  • line 433 of /admin/index.php: call to upgrade_noncore()

======end snip=====


I don't have a folder named /moodle/theme/myoldertheme. Clicking on the more information link displays the following:


=====snip=====

Let me guess, you arrived here after trying to install a new theme? If so then check that the version.php of the theme in question, and make sure that it is completed correctly, especially this line...

$plugin->component = 'theme_yourthemename'; // Full name of the plugin (used for diagnostics)

...where 'yourthemename' is the correct spelling of the theme you are trying to install.

=====end snip======


I was not trying to install a theme, rather an upgrade.  Currently using 2.9.  Here's my cron job:

/usr/local/bin/php -q /home/barbhall/public_html/learnpianotechnology.com/moodle/admin/cli/cron.php


Can anyone help?

Thanks in advance,

Barb


Average of ratings: -
In reply to Barb Hall

Re: Cron jobs and restore

by Ken Task -
Picture of Particularly helpful Moodlers

In answer to 'restore moodle from a cron job', I'd say no.

So let's work on fixing the issue.

First check to see if there is a folder in:

/home/barbhall/public_html/learnpianotechnology.com/moodle/theme/

by myoldertheme.

If there is, move it out of that folder to another location ... like /home/barbhall/

If there is not, then suggest doing this to *possibly* get by the issue for now:

In config.php add the following line:

$CFG->theme='clean';

The clean theme is one of the two themes that come with version 2.9 of Moodle.

No need to reboot/restart anything, just open a browser and before you attempt to access your site clear browser cache.

Then see if you can get to your site.

If you cannot, then it might be that the server has cached the old theme ...

Attempt going directly to: http://yoursite/[pathtomoodleifneeded]/admin/purgecaches.php

That should prompt you to login and it should re-direct to the php file given above.

'spirit of sharing', Ken