Dejan Muhamedagic wrote:
On Mon, May 21, 2007 at 03:58:29PM -0400, Knight, Doug wrote:
Is it possible to configure heartbeat to trigger a job that would
normally be triggered as a cronjob? For instance, I have a database
maintenance script that only runs once a night during a non-peak period.
It assumes that it is running on a server where the database is
available. What I'd like to be able to do is configure heartbeat to
trigger this job once a day, just like crontab is currently doing, but
ONLY on the server where the database is currently running and managed
by heartbeat. I plan on modifying the crontab script to become an
LSB/OCF type script accessible by heartbeat.

Put something like

    crm_resource -W -r your_db_resource | grep -qs `uname -n` ||
        exit

at the top of your script. Please check the output of crm_resource
beforehand to set this right.


Doug Knight
WSI, Inc.
Andover, MA

_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


Hello,

Whilst this wouldn't be the usual use for cluster cron, this may be another option. Configure cluster cron as required and add it as a basic native resource (fairly simple OCF script available if useful) in the same group as the service you wish it to be co-located with. Then you should be able to ensure that any cron jobs run as needed on the same host as is running the co-located service.

Pete
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to