226. Restore

Data for configuration of restore, input and output functions.

226.1. Authors

  • Ladislav Slezak <lslezak@suse.cz>

226.2. Summary of Module Globals

List of Global Functions

List of Global Variables

226.3. Global Functions

226.3.1. ActivateBootloader

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

Return value

  • boolean - true on success

226.3.2. ClearInstalledPackagesCache

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

Return value

  • void

226.3.3. Export

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

Return value

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

226.3.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" ]

226.3.5. GetArchiveComment

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

Return value

  • string - Archive comment

226.3.6. GetArchiveDate

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

Return value

  • string - Date

226.3.7. GetArchiveFiles

Return list of files in the backup archive

Return value

  • list - Files in the archive

226.3.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

226.3.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.

226.3.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

226.3.11. GetArchiveName

Return name of backup archive

Return value

  • string - File name

226.3.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

226.3.13. GetInputName

Return name of backup archive

Return value

  • string - Input name file name

226.3.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

226.3.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

226.3.16. GetSelectedPackages

Returns selected packages (even partially).

Return value

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

226.3.17. Import

Get all restore settings - for use by autoinstallation

Function parameters

  • map settings

Return value

  • boolean - True on success

226.3.18. IsMultiVolume

Selected archive has more parts

Return value

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

226.3.19. Modified

Return modified flag

Return value

  • boolean - true if modified

226.3.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) ];

226.3.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, ...)

226.3.22. ReadActualInstalledPackages

Read installed packages.

Return value

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

226.3.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) ]

226.3.24. ResetAll

Clear all settings (archive and list of installed packages)

Return value

  • void

226.3.25. ResetArchiveSelection

Clear all archive settings

Return value

  • void

226.3.26. Set

Set settings

Function parameters

  • map settings

Return value

  • void

226.3.27. SetRestoreSelection

Change restore selection of package.

Function parameters

  • string pkgname

  • map selection

Return value

  • void

226.3.28. SetSelectionProperty

Set selection in _auto client and display properties of archive

Function parameters

  • map<string,map> settings

Return value

  • void

226.3.29. Summary

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

Return value

  • string - rich text summary

226.3.30. TestAllVolumes

Test all volumes together

Return value

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

226.3.31. TotalFilesToRestore

Return number of files which will be unpacked from archive

Return value

  • integer - Total selected files

226.3.32. TotalPackagesToRestore

Return number of packages which will be restored from archive

Return value

  • integer - Total selected packages

226.3.33. Umount

Umount mounted file system.

Return value

  • void

226.3.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" ] ]

226.4. Global Variables

226.4.1. restoreRPMdb

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

226.4.2. runSuSEconfig

Run SuSEconfig after files are restored

226.4.3. runbootloader

Run lilo after files are restored

226.5. Module Requirements

226.5.1. Module Imports

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

226.5.2. Module Includes