211. Restore

Data for configuration of restore, input and output functions.

211.1. Summary of Module Globals

List of Global Functions

List of Global Variables

211.2. Global Functions

211.2.1. ActivateBootloader

Activate boot loader configuration if requested. Uses variable Restore::runbootloader

Return value

  • boolean - true on success

211.2.2. ClearInstalledPackagesCache

Clear cache of installed packages. Next use of GetActualInstalledPackages() function will reread installed packages.

Return value

  • void

211.2.3. Export

Dump the restore settings to a single map - for use by autoinstallation.

Return value

  • map - Dumped settings (later acceptable by Import ())

211.2.4. GetActualInstalledPackages

Return installed packages. Result is cached in Restore module, so only first use takes long time

Return value

  • map<string,string> - Map $[ "packagename" : "version" ]

211.2.5. GetArchiveComment

Return user comment stored in archive. Comment is stored in file info/comment.

Return value

  • string - Archive comment

211.2.6. GetArchiveDate

Return date when backup archive was created. Date is stored in archive in file info/date.

Return value

  • string - Date

211.2.7. GetArchiveFiles

Return list of files in the backup archive

Return value

  • list - Files in the archive

211.2.8. GetArchiveHostname

Return host name of machine on which backup archive was created. Host name is stored in archive in file info/hostname.

Return value

  • string - Host name

211.2.9. GetArchiveInfo

Return restore configuration

Return value

  • map<string, map<string, any> > - Map $[ "packagename" : $["vers" : "version", "files" : ["files in the archive"], "prefix" : "installprefix", "descr" : "Short description", "sel_type" : "X", "sel_file" : ["selected files to restore"] ] ], possible values for "sel_type" key are: "X" - restore all files from archive, " " - do not restore this package, "P" - partial restore, restore only selected files at "sel_file" key. Package name "" means files not owned by any package.

211.2.10. GetArchiveInstalledPackages

Return map with packages installed at backup time (form is $["package name" : "version"]).

Return value

  • map<string,string> - Installed packages at backup time

211.2.11. GetArchiveName

Return name of backup archive

Return value

  • string - File name

211.2.12. GetExtraPackages

Return extra packages (packages which are installed at restore time, but at restore time they are installed)

Return value

  • map<string,map<string,string> > - Map $[ "packagename" : $[ "ver" : "version", "descr" : "Short description of the package"]], key description is present only if decription exists

211.2.13. GetInputName

Return name of backup archive

Return value

  • string - Input name file name

211.2.14. GetMismatchedPackages

Return packages which have different version at backup archive and in system

Return value

  • map<string, map <string, string> > - Map $[ "packagename" : $[ "inst": "installed version", "ver" : "version at backup time, "descr" : "Short description of the package"]], key description is present only if decription exists

211.2.15. GetMissingPackages

Return missing packages (packages which were installed at backup time, but at restore time they are not installed)

Return value

  • map<string, map<string, string> > - Map $[ "packagename" : $[ "ver" : "version", "descr" : "Short description of the package"]], key description is present only if decription exists

211.2.16. GetSelectedPackages

Returns selected packages (even partially).

Return value

  • map<string, map> - Map with same keys as map returned by GetArchiveInfo()

211.2.17. Import

Get all restore settings - for use by autoinstallation

Function parameters

  • map settings

Return value

  • boolean - True on success

211.2.18. IsMultiVolume

Selected archive has more parts

Return value

  • boolean - boolen True if archive have more than one part.

211.2.19. Modified

Return modified flag

Return value

  • boolean - true if modified

211.2.20. MountInput

Mount input source

Function parameters

  • string input

Return value

  • map - Map $[ "success" : boolean (true on success), "mpoint" : string (mount point), "file" : string (file name on the local system) ];

211.2.21. Read

Read contents of archive

Function parameters

  • string input

Return value

  • boolean - True if archive was succesfully read, otherwise false (file does not exist, not tar archive, broken archive, archive not created by Backup module, ...)

211.2.22. ReadActualInstalledPackages

Read installed packages.

Return value

  • map<string,string> - Map $[ "packagename" : "version" ]

211.2.23. ReadNextVolume

Read next volume of multi volume archive

Function parameters

  • string input

Return value

  • map - Map $[ "success" : boolean (true on success), "lastvolume" : boolean (true if archive is last volume) ]

211.2.24. ResetAll

Clear all settings (archive and list of installed packages)

Return value

  • void

211.2.25. ResetArchiveSelection

Clear all archive settings

Return value

  • void

211.2.26. Set

Set settings

Function parameters

  • map settings

Return value

  • void

211.2.27. SetRestoreSelection

Change restore selection of package.

Function parameters

  • string pkgname

  • map selection

Return value

  • void

211.2.28. SetSelectionProperty

Set selection in _auto client and display properties of archive

Function parameters

  • map<string,map> settings

Return value

  • void

211.2.29. Summary

Create restore configuration summary. Used in autoinstallation restore module configuration.

Return value

  • string - rich text summary

211.2.30. TestAllVolumes

Test all volumes together

Return value

  • boolean - True: all volumes are OK, false: an error occured

211.2.31. TotalFilesToRestore

Return number of files which will be unpacked from archive

Return value

  • integer - Total selected files

211.2.32. TotalPackagesToRestore

Return number of packages which will be restored from archive

Return value

  • integer - Total selected packages

211.2.33. Umount

Umount mounted file system.

Return value

  • void

211.2.34. Write

Restore files from archive

Function parameters

  • block<boolean> abort

  • symbol progress

  • string targetdir

Return value

  • map - Map $[ "aborted" : boolean, "restored" : [ "restored file" ], "failed" : [ "failed file" ] ]

211.3. Global Variables

211.3.1. restoreRPMdb

Rewrite RPM db - unapack /var/lib/rpm/* files from backup if present

211.3.2. runSuSEconfig

Run SuSEconfig after files are restored

211.3.3. runbootloader

Run lilo after files are restored

211.4. Module Requirements

211.4.1. Module Imports

  • Bootloader
  • Label
  • Message
  • Mode
  • Package
  • Popup
  • Progress
  • Report
  • Service
  • String
  • Summary
  • URL

211.4.2. Module Includes