Changes

Jump to: navigation, search

stoney backup: Notification Overview

1,677 bytes added, 12:31, 20 June 2014
/* Source Code */
[[File:Notification-receiver-workflow.png|500px|thumbnail|none|Figure 1: Who will receive notification mails]]
= Template distribution =
As the templates should be editable for resellers, they are stored on the server which is running the selfcare web interface. On a default stoney cloud setup this will be the [[Primary-Master-Node | primary master node]]. However as described on the [[stoney_cloud:_Notification_Architecture#File_System | notification architecture page]], the templates need to be present on server where the notification process takes place. As we do not have shared storage resources for the primary master node and VMs, the solution is to regularly (once a day) copy the templates from the primary master node to where they should go (for example the backup server):
/etc/cron.d/distribute-templates
<pre>
# Distribute selfcare templates
00 04 * * * /root/distributeTemplates.sh | logger -t distributeTemplates
</pre>
/root/distributeTemplates.sh
<source lang="bash">
#!/bin/bash
 
readonly backup_server="<Server>"
readonly username="<user>"
readonly identity_file=/root/.ssh/id_rsa_demo
readonly themes_source_directory=/var/www/selfcare/htdocs/themes/
readonly themes_destination_directory=/var/www/selfcare/htdocs/themes/
readonly files_from="/root/distribute_backup_templates.txt";
 
rsync -vrlt --delete -e "ssh -i ${identity_file}" --files-from ${files_from} ${themes_source_directory} ${username}@${backup_server}:${themes_destination_directory}
</source>
/root/distribute_backup_templates.txt
<pre>
<reseller1-themes-direcory>/templates/services/<servce>/
<reseller2-themes-direcory>/templates/services/<servce>/
</pre>
For example:
<pre>
selfcare.reseller.org/templates/services/backup/
selfcare.another-reseller.org/templates/services/backup/
</pre>
= Source Code =
The source code is located in our GitHub Repository:
486
edits