user-1906
18-07-2018, 10:21 AM
Following on from my attempts at writing something to shorten a variable - in this instance it was firstbcastdate - I made it into a preset. Except it didn't run. I got an error :-
INFO: Running user command
sh: 1: Bad substitution
INFO: Command exit code 2 (raw code = 512)
ERROR: Command Exit Code: 2
GiP is running on an Ubuntu box but not as me. Instead it runs as a user called xbox. I had problems persuading anything to run under that user so added these lines to my gip script for cron :-
# ensure environment variables are set: cron jobs do not have these set
if [ -z "$HOME" ]; then
export HOME=/home/xbox
So, in an effort to make my preset work, I turned it into a fully-fledged bash script and used the preset to call it. But .... it stops the commandtv line in my options from working.
The question is, should it? Running GiP in verbose mode, I can see this in the logs (removed the stuff that didn't relate to this) :-
INFO: PVR Run: 'ONCE_b0bbc6q5'
-==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-
Current options:
commandtv = /home/xbox/GiP_Scripts/click_folder_rename.sh
fileprefix = <nameshort>_<firstbcastdate>
outputtv = /mnt/raid2/Media_Share/GiP_Downloads/tv/
pid = b0bbc6q5
preset = click_folder_rename
INFO: Running user command
INFO: Running command '/home/xbox/GiP_Scripts/click_folder_rename.sh'
INFO: Command: /home/xbox/GiP_Scripts/click_folder_rename.sh
++ ls /mnt/raid2/Media_Share/GiP_Downloads/tv/Click/
+ subdir=2018-07-14
+ short=2018
+ mv /mnt/raid2/Media_Share/GiP_Downloads/tv/Click/2018-07-14 /mnt/raid2/Media_Share/GiP_Downloads/tv/Click/2018
INFO: Command exit code 0 (raw code = 0)
INFO: Command succeeded
New tv programme: 'Click - Grand Tech Auto', 'Click goes behind the scenes at the Austrian Grand Prix.'
INFO: Deleted PVR search 'ONCE_b0bbc6q5'
-==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-
Is it because I've asked the preset to call a bash script that this happens and I can only run one bash script command, or do I have to queue them in the commandtv option instead. Or can I not do that either?
This is the relevant line from the options :-
get_iplayer --prefs-show
Options in '/home/xbox/.get_iplayer/options'
commandtv = /home/xbox/Old_Scripts/find_mp4.sh
INFO: Running user command
sh: 1: Bad substitution
INFO: Command exit code 2 (raw code = 512)
ERROR: Command Exit Code: 2
GiP is running on an Ubuntu box but not as me. Instead it runs as a user called xbox. I had problems persuading anything to run under that user so added these lines to my gip script for cron :-
# ensure environment variables are set: cron jobs do not have these set
if [ -z "$HOME" ]; then
export HOME=/home/xbox
So, in an effort to make my preset work, I turned it into a fully-fledged bash script and used the preset to call it. But .... it stops the commandtv line in my options from working.
The question is, should it? Running GiP in verbose mode, I can see this in the logs (removed the stuff that didn't relate to this) :-
INFO: PVR Run: 'ONCE_b0bbc6q5'
-==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-
Current options:
commandtv = /home/xbox/GiP_Scripts/click_folder_rename.sh
fileprefix = <nameshort>_<firstbcastdate>
outputtv = /mnt/raid2/Media_Share/GiP_Downloads/tv/
pid = b0bbc6q5
preset = click_folder_rename
INFO: Running user command
INFO: Running command '/home/xbox/GiP_Scripts/click_folder_rename.sh'
INFO: Command: /home/xbox/GiP_Scripts/click_folder_rename.sh
++ ls /mnt/raid2/Media_Share/GiP_Downloads/tv/Click/
+ subdir=2018-07-14
+ short=2018
+ mv /mnt/raid2/Media_Share/GiP_Downloads/tv/Click/2018-07-14 /mnt/raid2/Media_Share/GiP_Downloads/tv/Click/2018
INFO: Command exit code 0 (raw code = 0)
INFO: Command succeeded
New tv programme: 'Click - Grand Tech Auto', 'Click goes behind the scenes at the Austrian Grand Prix.'
INFO: Deleted PVR search 'ONCE_b0bbc6q5'
-==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-
Is it because I've asked the preset to call a bash script that this happens and I can only run one bash script command, or do I have to queue them in the commandtv option instead. Or can I not do that either?
This is the relevant line from the options :-
get_iplayer --prefs-show
Options in '/home/xbox/.get_iplayer/options'
commandtv = /home/xbox/Old_Scripts/find_mp4.sh