26. Backup

26.1. Summary of Module Globals

List of Global Functions

List of Global Variables

    26.2. Global Functions

    26.2.1. BackupProfileDescriptions

    Helper function to extract the list of currently available profiles

    Return value

    • list<term> - List of item used in the table widget

    26.2.2. BackupProfileNames

    Get a sorted list of profile names currently available.

    Return value

    • list<string> - the list of strings (possibly empty).

    26.2.3. CreateCronDescription

    Create description of automatic backup.

    Function parameters

    • string profilename

    Return value

    • string - description string or empty string if profile has disabled automatic start

    26.2.4. CreateCronSetting

    Create cron file content for selected profile.

    Function parameters

    • string profilename

    Return value

    • string - Cron content or empty string if profile has disabled automatic start

    26.2.5. DetectedMountPoints

    Returns detected mount points

    Return value

    • map - detected mount points

    26.2.6. ExcludeNodevFS

    Exclude file systems without device

    Return value

    • void

    26.2.7. GetCapacity

    Return capacity of required medium

    Function parameters

    • list<map<string,any> > media

    • symbol m

    Return value

    • integer - Size of medium in bytes

    26.2.8. GetLocalArchiveName

    Returns local archive name (required if NFS target is used)

    Return value

    • string - local archive name

    26.2.9. MapFilesToString

    Writes file using the .backup.file_append SCR agent. This file is accepted by backup_archive.pl script. Used global variables: selected_files, backup_files.

    Return value

    • map - with keys "sel_files" (integer - number of selected files), "sel_packages" (integer: number of selected packages), "ret_file_list_stored" (boolean: whether the filelist has been completely stored)

    26.2.10. PostBackup

    Post-backup function - unmount mounted NFS share

    Return value

    • boolean - true on success

    26.2.11. PrepareBackup

    Pre-backup function - mount NFS share if required

    Return value

    • boolean - true on success

    26.2.12. ReadBackupProfiles

    Read backup profiles from file, do not set any global settings, just

    Return value

    • boolean - true if there are some profiles available

    26.2.13. ReadCronSetting

    Parse cron file

    Function parameters

    • string filename

    Return value

    • map - parsed values: $["auto":boolean, "day":integer, "hour":integer, "minute":integer, "weekday":integer, "every":symbol] or empty map if parse error occured

    26.2.14. ReadCronSettings

    Parse all /etc/cron.d/yast2-backup-* files and update profiles

    Return value

    • void

    26.2.15. ReadInstallablePackages

    Read all packages available on the installation sources

    Return value

    • void

    26.2.16. RemovableDevices

    Try to detect all removable devices present in the system

    Function parameters

    • boolean only_writable

    Return value

    • map - Removable devices info

    26.2.17. RemoveBackupProfile

    Remove given profile.

    Function parameters

    • string profile_name

    • boolean remove_cronfile

    Return value

    • boolean - If the name of the profile cannot be found, return false, otherwise return true.

    26.2.18. RemoveOldArchives

    Remove and/or rename old existing archives

    Function parameters

    • string name

    • integer max

    • boolean multivolume

    Return value

    • map - result

    26.2.19. RemoveOldMultiArchives

    Remove and/or rename old existing multivolume archives

    Function parameters

    • string name

    • integer max

    Return value

    • map - result

    26.2.20. RemoveOldSingleArchives

    Remove and/or rename old existing single archives

    Function parameters

    • string name

    • integer max

    Return value

    • map - result

    26.2.21. RestoreDefaultSettings

    Restore the default global settings.

    Return value

    • void

    26.2.22. RestoreSettingsFromBackupProfile

    Restore the global settings from a given backup profile.

    Function parameters

    • string profile_name

    Return value

    • boolean - If the name of the profile cannot be found, return false, otherwise return true.

    26.2.23. StoreSettingsToBackupProfile

    Take the current profile information and store it into a given profile. If the profile already exists, it will be overwritten.

    Function parameters

    • string profile_name

    Return value

    • void

    26.2.24. WriteBackupProfiles

    Write the backup profiles to a file - hardcoded configuration_filename.

    Return value

    • boolean - true if the write operation was successful.

    26.2.25. WriteCronSettings

    Write cron settings from profiles to /etc/cron.d/yast2-backup-* files

    Return value

    • void

    26.2.26. WriteProfile

    Write autoinstallation profile to file autoinst.xml to the same directory as archive

    Function parameters

    • list<string> volumes

    Return value

    • map - map $[ "result" : boolean (true on success), "profile" : string (profile file name) ]

    26.2.27. get_archive_script_parameters

    Return backup_search.pl script parameters according to state of variables

    Function parameters

    • string file_list

    • string file_comment

    Return value

    • string - String with command line parameters

    26.2.28. get_search_script_parameters

    Return backup_search.pl script parameters according to state of variables

    Return value

    • string - String with command line parameters

    26.3. Global Variables

    26.4. Module Requirements

    26.4.1. Module Imports

    • FileUtils
    • Nfs
    • Popup
    • Progress
    • Report
    • Service
    • String

    26.4.2. Module Includes

    • backup/functions.ycp