Hi,
to refresh my libary and clean it, i connect via ssh and write these command:
xbmc-send --action="CleanLibrary(video)"
xbmc-send --action="UpdateLibrary(video)"
it works fine.
But now i would like to perform these commands in one script. Like “refresh.py”
Is there a solution to do that ?
Would be perfect.
thx
mcobit
14 January 2017 14:10
2
Sure:
Create a new file:
touch maintenance.sh
Make it executable:
chmod +x maintenance.sh
Open it and put your commands in. One per line:
nano maintenance.sh
Close the editor with ctrl +x and save.
Run your new bash script:
./maintenance.sh
nice thanks! can i make a pause between the scripts, or wait till the first script has finshed ?
mcobit
14 January 2017 14:18
4
The lines in the script will be executed one after another.
If you need a longer pause in between, add a line in between with:
sleep x
Where x is a number in seconds to wait before doing the next command.
mcobit
14 January 2017 14:21
5
If you want to know more about bash scripting, here is a good tutorial:
mcobit
14 January 2017 14:23
6
It will work without, but to be safe, the first line of your script should be:
#!/bin/bash
mcobit
14 January 2017 14:27
8
See my edit.
Put everything in codetags now so it is not messed up by the forum. The # got removed in the section quoted by you.
mcobit
14 January 2017 14:36
9
If you want to go even more automated, google for cron.
i would more like to map this script to my IR Remote. So that i push a button, it starts.
But i cant finde the file where i can change the buttons.
The standard buttons are working. But where can change them? You know that?
mcobit
14 January 2017 14:45
11
Search the forum for “script on remote press”
This should help you on your way: http://kodi.wiki/view/Keyboard.xml
btw, i would swap the order clean and update