| | |
| | | </function> |
| | | |
| | | <!-- Import-ldif Function --> |
| | | <function name="ImportLdifWithScript"> |
| | | <function name="ImportLdifWithScript" scope="local"> |
| | | <function-prolog> |
| | | This function performs an import of an ldif file |
| | | </function-prolog> |
| | |
| | | <call function="'_adminCommonArgs'" /> |
| | | |
| | | <script> |
| | | foldersToCreate = [] |
| | | |
| | | if dsPath: |
| | | dsBinPath='%s/%s' % (dsPath,fileFolder) |
| | | STAFCmd='%s/import-ldif%s' % (dsBinPath,fileExt) |
| | |
| | | STAFCmdParamsList.append('-S') |
| | | |
| | | if skipFile: |
| | | if not os.path.exists(os.path.dirname(skipFile)): |
| | | os.makedirs(os.path.dirname(skipFile)) |
| | | |
| | | foldersToCreate.append(os.path.dirname(skipFile)) |
| | | STAFCmdParamsList.append('--skipFile %s' % skipFile) |
| | | |
| | | if rejectFile: |
| | | if not os.path.exists(os.path.dirname(rejectFile)): |
| | | os.makedirs(os.path.dirname(rejectFile)) |
| | | |
| | | foldersToCreate.append(os.path.dirname(rejectFile)) |
| | | STAFCmdParamsList.append('-R %s' % rejectFile) |
| | | |
| | | if overwriteFile: |
| | |
| | | |
| | | </script> |
| | | |
| | | <call function="'createMultiFolders'"> |
| | | { 'location' : location, |
| | | 'folderslist' : foldersToCreate |
| | | } |
| | | </call> |
| | | |
| | | <message> |
| | | '%s %s' % (STAFCmd, STAFCmdParams) |
| | | </message> |
| | | |
| | | <message> |
| | | 'Start import-ldif' |
| | | </message> |
| | |
| | | </function> |
| | | |
| | | <!-- Export-ldif Function --> |
| | | <function name="exportLdifWithScript"> |
| | | <function name="exportLdifWithScript" scope="local"> |
| | | <function-prolog> |
| | | This function performs an on line export task of an ldif file |
| | | </function-prolog> |
| | |
| | | <call function="'_adminCommonArgs'" /> |
| | | |
| | | <script> |
| | | foldersToCreate = [] |
| | | |
| | | if dsPath: |
| | | dsBinPath='%s/%s' % (dsPath,fileFolder) |
| | | STAFCmd='%s/export-ldif%s' % (dsBinPath,fileExt) |
| | |
| | | STAFCmdParamsList.append('-p %s' % dsInstancePort) |
| | | |
| | | if ldifFile: |
| | | if not os.path.exists(os.path.dirname(ldifFile)): |
| | | os.makedirs(os.path.dirname(ldifFile)) |
| | | |
| | | foldersToCreate.append(os.path.dirname(ldifFile)) |
| | | STAFCmdParamsList.append('-l %s' % ldifFile) |
| | | |
| | | if startTask: |
| | |
| | | |
| | | </script> |
| | | |
| | | <call function="'createMultiFolders'"> |
| | | { 'location' : location, |
| | | 'folderslist' : foldersToCreate |
| | | } |
| | | </call> |
| | | |
| | | <message> |
| | | '%s %s' % (STAFCmd, STAFCmdParams) |
| | | </message> |
| | | |
| | | <message> |
| | | 'Start export-ldif' |
| | | </message> |
| | |
| | | </function> |
| | | |
| | | <!-- Backup Function --> |
| | | <function name="backup"> |
| | | <function name="backup" scope="local"> |
| | | <function-prolog> |
| | | This function performs an off line backup |
| | | </function-prolog> |
| | |
| | | <call function="'_adminCommonArgs'" /> |
| | | |
| | | <script> |
| | | foldersToCreate = [] |
| | | |
| | | if dsPath: |
| | | dsBinPath='%s/%s' % (dsPath,fileFolder) |
| | | STAFCmd='%s/backup%s' % (dsBinPath,fileExt) |
| | | |
| | | if backupDir: |
| | | if not os.path.exists(os.path.dirname(backupDir)): |
| | | os.makedirs(os.path.dirname(backupDir)) |
| | | |
| | | foldersToCreate.append(os.path.dirname(backupDir)) |
| | | STAFCmdParamsList.append('-d %s' % backupDir) |
| | | |
| | | if backEnd: |
| | |
| | | STAFCmdParams=' '.join(STAFCmdParamsList) |
| | | |
| | | </script> |
| | | |
| | | <call function="'createMultiFolders'"> |
| | | { 'location' : location, |
| | | 'folderslist' : foldersToCreate |
| | | } |
| | | </call> |
| | | |
| | | <message> |
| | | '%s %s' % (STAFCmd, STAFCmdParams) |
| | | </message> |
| | | |
| | | <message> |
| | | 'Start backup' |
| | | </message> |
| | | |
| | | <call function="'runCommand'"> |
| | | { 'location' : location, |
| | | 'name' : 'Backup Script', |