bondjimbond / islandora_westvault

Automated preservation for Islandora objects
GNU General Public License v3.0
1 stars 1 forks source link

Set up for cron tasks #15

Closed bondjimbond closed 5 years ago

bondjimbond commented 5 years ago

As @mjordan pointed out, including owncloudcmd commands in the module proper could cause problems due to timeout.

Instead, it's better to create a cron job on the server itself.

This is fine, except that it means we can't get as much leverage out of Drupal as I'd like. e.g. variables (username, password, paths) in admin forms.

Is there any way to pull variables from Drupal into what we execute in Cron?

mjordan commented 5 years ago

Yup, write a drush script to call the functions in your module, and run the drush script in the system cronjob. Checksum checker does this, as do other modules.

bondjimbond commented 5 years ago

Interesting... So I could cut this function from utilities.inc, stick it in a drush script, and then run the drush script in cron...

How would this work in a multisite environment? i.e. each site has its own module configuration, need a drush command for each implementation...

Would it work if cron were instructed to run the command in sites/SITE1/ and execute with SITE1's data, then another command in sites/SITE2 and run with SITE2's data?

mjordan commented 5 years ago

@bondjimbond sorry, I have absolutely no experience with multisite. Probably best to ask on the Islandora email group about how running drush scripts via linux cron works in that type of environment.