Backup8 - Lua script
Lua debugger helps you to develop backup script
Description
- Script editor
Enter or modify your lua script here - Debug output pane
View script debug output - Profiles
Run your script and view the results - Functions
Create new script, open an existing script, save current script or run script
Backup8 supports lua functions
function
profile_add(name, description, icon_path)
parameters
- name
the profile name - description
the description of the new profile - icon_path
the icon path and filename, only need to provide filename if the icon has been stored in %appdata%\backup8\icons
remark: use this function to add a new profile and returns a new profile id, icon file should be png, bmp, gif, jpg and 32x32 pixels
function
path_add(profile_id, path)
parameters
- profile_id
the profile id, created by function profile_add - path
the path to be added to the profile, can use %appdata% etc
remark: this function will return nil if fail
function
path_is_belong(full_path, parent_path)
parameters
- full_path
the full path - parent_path
the parent path
remark: this function will return true if full_path is a sub-directory of parent_path otherwise return false
function
path_get_mydocuments()
remark: this function will return the full path of 'My Documents' folder
function
path_get_profile()
remark: this function will return the full path of 'My Documents' parent folder
function
reg_add(profile_id, hkey, path)
parameters
- profile_id
the profile id, created by function profile_add - hkey
the root-key of registry - path
the sub key-path of registry
remark: this function will return nil if fail, here are the values of root-key: 0-HKEY_CLASSES_ROOT, 1: HKEY_CURRENT_USER, 2: HKEY_LOCAL_MACHINE, 3: HKEY_USERS, 4: HKEY_CURRENT_CONFIG
function
reg_read(hkey, path, value_name)
parameters
- hkey
the root-key value, please read the remark section of function reg_add - path
the sub key-path of registry - value_name
the registry value-name
remark: this function will return nil if fail, if the value-type is string, function will return string-type, if the value-type is DWORD, function will return integer-type, otherwise the function will return nil
function
reg_enum_subkey(hkey, path)
parameters
- hkey
the root-key value, please read the remark section of function reg_add - path
the sub key-path of registry
remark: this function will return nil if error, otherwise it will return an array of all sub-keys in string-type
function
reg_enum_val_name(hkey, path)
parameters
- hkey
the root-key value, please read the remark section of function reg_add - path
the sub key-path of registry
remark: this function will return nil if error, otherwise it will return an array of all value names from the registry key-path
function
reg_decode_path(hkey, path, val_name)
parameters
- hkey
the root-key value, please read the remark section of function reg_add - path
the sub key-path of registry - val_name
the value-name
remark: this function will try to decode the path from the given binary data
function
file_read_lines(filename)
parameters
- filename
the filename of the source text file
remark: this function will return nil if fail or return all lines from the file in array
function
re_match(string, regex_string)
parameters
- string
the string to match - regex_string
regular expression string
remark: this function will return nil if cannot match the string with regular expression or return array with all match results