mirror of
https://github.com/robweber/xbmcbackup.git
synced 2024-11-15 04:45:49 +01:00
updated for sets functionality
parent
054aff9b1e
commit
cc66a79108
14
Scripting.md
14
Scripting.md
@ -1,6 +1,6 @@
|
|||||||
## Scripting A Backup
|
### Scripting A Backup
|
||||||
|
|
||||||
If you wish to script this addon using an outside scheduler or script it can be given parameters via the Kodi.RunScript() or JsonRPC.Addons.ExecuteAddon() methods. Parameters given are either "backup" or "restore" to launch the correct program mode. If mode is "restore", an additional "archive" parameter can be given to set the restore point to be used instead of prompting via the GUI. An example would be:
|
If you wish to script this addon using an outside scheduler or script it can be given parameters via the Kodi.RunScript() or JsonRPC.Addons.ExecuteAddon() methods. Parameters given are either "backup" or "restore" to launch the correct program mode. If mode is "restore", an additional "archive" and "sets" parameters can be given to set the restore point to be used instead of prompting via the GUI. An example of a backup would be:
|
||||||
|
|
||||||
Python code:
|
Python code:
|
||||||
```python
|
```python
|
||||||
@ -12,6 +12,16 @@ JSON Request:
|
|||||||
{ "jsonrpc": "2.0", "method": "Addons.ExecuteAddon","params":{"addonid":"script.xbmcbackup","params":{"mode":"restore","archive":"000000000000"}}, "id": 1 }
|
{ "jsonrpc": "2.0", "method": "Addons.ExecuteAddon","params":{"addonid":"script.xbmcbackup","params":{"mode":"restore","archive":"000000000000"}}, "id": 1 }
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To script a Restore you need to pass in the archive folder name and the sets within that archive you wish to restore _(version 1.5.0 and greater)_. An example of this would be:
|
||||||
|
|
||||||
|
JSON Request:
|
||||||
|
```
|
||||||
|
{ "jsonrpc": "2.0", "method": "Addons.ExecuteAddon","params":{"addonid":"script.xbmcbackup","params":{"mode":"restore","archive":"000000000000","sets":"config|database"}}, "id": 1 }
|
||||||
|
|
||||||
|
```
|
||||||
|
_Note the pipe symbol ( | ) between set names._
|
||||||
|
|
||||||
|
### Check If Backup Running
|
||||||
There is also a windows parameter that can be used to check if Kodi Backup is running within a skin or from another program. It is attached to the home window, an example of using it would be the following:
|
There is also a windows parameter that can be used to check if Kodi Backup is running within a skin or from another program. It is attached to the home window, an example of using it would be the following:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
Loading…
Reference in New Issue
Block a user