public override void DoAction(bool onRemote, bool isFromMe) { if (onRemote && isFromMe) { return; } Debug.WriteLine(String.Format("@> {0} RequestBackupIndexMessage received. onRemote: {1}, isFromMe: {2}, id: {3}", AppDomain.CurrentDomain.FriendlyName, onRemote, isFromMe, SenseNet.ContentRepository.Storage.Data.RepositoryConfiguration.IndexBackupCreatorId)); if (Environment.MachineName == _machine && SenseNet.ContentRepository.Storage.Data.RepositoryConfiguration.IndexBackupCreatorId == _indexBackupCreatorId) { Debug.WriteLine(String.Format("@> {0} =========== BackupIndex START id: {1}", AppDomain.CurrentDomain.FriendlyName, SenseNet.ContentRepository.Storage.Data.RepositoryConfiguration.IndexBackupCreatorId)); string msg = null; BackupTools.DistributedNotifyProgress = true; try { new IndexBackupStartedMessage("Index backup has started.").Send(); BackupTools.SynchronousBackupIndex(); msg = String.Concat(BackupTools.Progress.Summary); } catch (Exception e) { //TODO: full exception msg = e.Message; } finally { BackupTools.DistributedNotifyProgress = false; } new IndexBackupFinishedMessage(msg).Send(); Debug.WriteLine(String.Format("@> {0} =========== BackupIndex END. id: {1}", AppDomain.CurrentDomain.FriendlyName, SenseNet.ContentRepository.Storage.Data.RepositoryConfiguration.IndexBackupCreatorId)); } }
public static void Backup() { BackupTools.SynchronousBackupIndex(); }