Backup module |
functions.ycp |
|
|
This module has an unstable interface. |
Display abort confirmation dialog
- Parameters:
-
type Select dialog type, possible values: `changed, `not_changed or `none for none dialog
- Return value:
-
False if user select to not abort, true otherwise.
Ask user for some value: display dialog with label, text entry and OK/Cancel buttons.
- Parameters:
-
label Displayed text above the text entry in the dialog value Default text in text entry, for empty text set value to "" or nil values
- Return value:
-
Returned map: $[ "text" : string, "clicked" : symbol ]. Value with key text is string entered by user, symbol is `ok or `cancel depending which button was pressed.
Returns list of mounted file systems types.
- Return value:
-
List of strings, each mounted file system type is reported only onetimes, list is alphabetically sorted.
- Example
-
GetMountedFilesystems() -> [ "devpts", "ext2", "nfs", "proc", "reiserfs" ]
Returns list of Ext2 mountpoints - actually mounted and from /etc/fstab file
- Return value:
-
List of strings
- Example
-
Ext2Filesystems() -> [ "/dev/hda1", "/dev/hda4" ]
This function reads two lists: full list and selection list (contains subset of items in full list). Returned list can be used in MultiSelectionBox widget.
- Parameters:
-
in List of items selected List with subset of items from list in.
- Return value:
-
List of alphabetically sorted strings
- Example
-
GetListWithFlags(["/dev", "/etc"], ["/etc"]) -> [`item (`id ("/dev"), "/dev", false), `item (`id ("/etc"), "/etc", true)]
Set boolean value val to all items in list.
- Parameters:
-
in Input list of items val Requested value
- Return value:
-
List of items
- Example
-
AddIdBool( [ `item(`id("ext2"), "ext2", true) ], false) ) -> [ `item (`id ("ext2"), "ext2", false) ]
Returns list of items from list of values.
- Parameters:
-
in Input list of values
- Return value:
-
List of items
- Example
-
AddId("abc", "123") -> [`item(`id("abc"), "abc"), `item(`id("123"), "123")]
Returns list of items from list of values.
- Parameters:
-
in Input list of maps with keys "partition", "mountpoints" and strings as values
- Return value:
-
List of items
- Example
-
AddId([ $["partition" : "/dev/hda3", "mountpoint" : "/usr"] ]) -> [`item(`id("/dev/hda3"), "/dev/hda3", "/usr")]
Convert media description list to ComboBox items list
- Parameters:
-
media Medium descriptions - list of maps with keys (and values): "label" (description string), "symbol" (identification symbol), "capacity" (size of free space on empty medium)
- Return value:
-
Items list for UI widgets
Set state of depending widgets in Multiple volume options dialog
Return mount point for Ext2 partition. This function at first checks if partition is mounted. If yes it returns actual mout point, if no it searches mount point from /etc/fstab file.
- Parameters:
-
device_name Name of device
- Return value:
-
Mount point of device or nil if device does not exist or there is other file system than Ext2
- Example
-
Ext2MountPoint("/dev/hda1") -> "/boot"
Add extension to the file name if it is missing.
- Parameters:
-
file filname extension file extension (with dot)
- Return value:
-
filename with extension
- Example
-
AddMissingExtension("filename", ".ext") -> "filename.ext" AddMissingExtension("filename.tar", ".gz") -> "filename.tar.gz" AddMissingExtension("filename.tar", ".tar") -> "filename.tar"
Get base file name without extension
- Parameters:
-
file file name
- Return value:
-
base file name
- Example
-
GetBaseName("file.ext") -> "file" GetBaseName("file") -> "file" GetBaseName("dir/file.ext") -> "file"
Send mail to specified user
- Parameters:
-
user Target email address subject Subject string message Message body
- Return value:
-
True on success
Create string from character ch with the same lenght as input
- Parameters:
-
input Input string ch String used in output
- Return value:
-
String containg size(input) character
Send summary mail of the backup process to root.
- Parameters:
-
remove_result Result of removing/renaming of the old archives cron_profile backup_result backup_details
- Return value:
-
True on success
Convert number of second since 1.1.1970 to string. Result has format YYYYMMDDHHMMSS
- Parameters:
-
sec Number of seconds
- Return value:
-
String representation of the time, returns input value (sec) if an error occured
Read packages available on the installation sources (Requires at least one installation source, otherwise return empty list)
- Return value:
-
available packages
Store autoyast profile of the system to file
- Parameters:
-
filename where setting will be saved additional additional part of system to clone extra_key name of the extra configuration extra_options options for extra_key
- Return value:
-
true on success
Detect mount points
- Return value:
-
map of mount points
Create table content with detected mount points
- Parameters:
-
selected selected mount points to use all all detected mount points + user defined dirs description detected mount points
- Return value:
-
table content
Check whether file on the NFS server exists
- Parameters:
-
server remote server name share exported directory filename name of the file
- Return value:
-
true - file exists, false - file doesn't exist, nil - error (mount failed)
Create NFS file description string
- Parameters:
-
server server name share exported directory name filename remote file name
- Return value:
-
result (nil if any of the parameter is nil)
Get available space in the directory
- Parameters:
-
directory selected directory
- Return value:
-
on success returns parsed df output in a map $["device" : string(device), "total" : integer(total), "used" : integer(used), "free" : integer(free) ]