m_context.locations->getSharedRootDir());
WrtUtilMakeDir(sharedPath);
+ WrtUtilMakeDir(m_context.locations->getSharedResourceDir());
if (m_context.isUpdateMode) { //update
- std::string backData = m_context.locations->getBackupSharedDir();
- LogDebug("copy shared storage " << backData << " to " << sharedPath);
- if (!DirectoryApi::DirectoryCopy(backData, sharedPath)) {
- LogError("Failed to rename " << backData << " to " << sharedPath);
+ std::string backSharedData = m_context.locations->getBackupSharedDir();
+ std::string BackSharedTrusted = m_context.locations->getBackupSharedDir();
+
+
+ /* Restore /shared/data */
+ LogDebug("copy " << m_context.locations->getBackupSharedDataDir() <<
+ " to " << m_context.locations->getSharedDataDir());
+ if (!DirectoryApi::DirectoryCopy(
+ m_context.locations->getBackupSharedDataDir(),
+ m_context.locations->getSharedDataDir())) {
+ LogError("Failed to rename " <<
+ m_context.locations->getBackupSharedDataDir() <<
+ " to " << m_context.locations->getSharedDataDir());
+ ThrowMsg(Exceptions::BackupFailed,
+ "Error occurs copy shared strage files");
+ }
+
+ /* Restore /shared/trusted */
+ LogDebug("copy " << m_context.locations->getBackupSharedTrustedDir() <<
+ " to " << m_context.locations->getSharedTrustedDir());
+ if (!DirectoryApi::DirectoryCopy(
+ m_context.locations->getBackupSharedTrustedDir(),
+ m_context.locations->getSharedTrustedDir())) {
+ LogError("Failed to rename " <<
+ m_context.locations->getBackupSharedTrustedDir() << " to " <<
+ m_context.locations->getSharedTrustedDir());
ThrowMsg(Exceptions::BackupFailed,
"Error occurs copy shared strage files");
}
} else {
- WrtUtilMakeDir(m_context.locations->getSharedResourceDir());
changeOwnerForDirectory(m_context.locations->getSharedDataDir(),
SHARED_STORAGE_MODE);
changeOwnerForDirectory(m_context.locations->getSharedTrustedDir(),