MP2-Edit - A MediaPortal 2 Media Library Editor (1 Viewer)

breese

Retired Team Member
  • Premium Supporter
  • July 11, 2011
    3,902
    770
    66
    Arlington Heights, Illinois
    Home Country
    United States of America United States of America
    As the resulting "Are you sure" question was invisible it can't be answered, so this leads to an infinite wait. Sorry guys.
    Tested this again....
    I was not asked the Are you sure question but a popup (that auto closed) with the message "Mission Accomplished" appeared.
    It did remove the Task Scheduler I had created earlier.
     

    Lehmden

    Retired Team Member
  • Premium Supporter
  • December 17, 2010
    12,565
    3,946
    Lehmden
    Home Country
    Germany Germany
    Hi.
    I was not asked the Are you sure question
    This question was asked in the hidden shell window in which the schtasks.exe was running. And as this window is hidden you can not see nor answer this question at all. The auto-closed popup is the visible sign for anything went right.
     

    breese

    Retired Team Member
  • Premium Supporter
  • July 11, 2011
    3,902
    770
    66
    Arlington Heights, Illinois
    Home Country
    United States of America United States of America
    The Task Scheduler is not working... I cannot find anything in the Event Viewer were it has even tried to start never the less failed.
    Here are the settings in task scheduler
    MP2-Edit_01.jpg

    Here is my backup folder and the files within it. You can see it has been a few days
    MP2-Edit_02.jpg

    MP2-Edit Backups
    MP2-Edit_03.jpg

    Once I open and close MP2-Edit the Backup Service starts
    MP2-Edit_04.jpg

    MP2-Edit_05.jpg

    From within task scheduler I turned on history logging and tried to run the task

    Task Scheduler failed to launch action "C:\Program" in instance "{db3460c8-a1f3-446a-b47f-53dd2977b991}" of task "\MP2-Backup". Additional Data: Error Value: 2147942402.

    Task Scheduler failed to start instance "{db3460c8-a1f3-446a-b47f-53dd2977b991}" of "\MP2-Backup" task for user "ACME.LOCAL\BUGSBUNNY$" . Additional Data: Error Value: 2147942402.
     

    MrTechno

    Retired Team Member
  • Premium Supporter
  • February 27, 2011
    1,256
    511
    London
    Home Country
    United Kingdom United Kingdom
    Task Scheduler failed to launch action "C:\Program" in instance "{db3460c8-a1f3-446a-b47f-53dd2977b991}" of task "\MP2-Backup". Additional Data: Error Value: 2147942402.
    Maybe the executable path needs to be in quotes?
     

    Lehmden

    Retired Team Member
  • Premium Supporter
  • December 17, 2010
    12,565
    3,946
    Lehmden
    Home Country
    Germany Germany
    Hi
    Will have a look at this later today. But as default the backup task is running as "System", not as an local user. So it looks like as if this schedule is not set up by MP2-Edit at all.
     

    Lehmden

    Retired Team Member
  • Premium Supporter
  • December 17, 2010
    12,565
    3,946
    Lehmden
    Home Country
    Germany Germany
    Hi.
    This is very strange as the MP2-Edit code definitely is adding quotes to the executable path. And as told before, the user to run MP2-Backup.exe from schedule is set to "System". I'm pretty sure this is not related to MP2-Edit as there is nothing I can find that can cause this.
    Here's the code:
    Code:
    $option = '/Create /RU SYSTEM /SC WEEKLY /D ' & $days & ' /TN MP2-Backup /TR "' & @ScriptDir & '\MP2-Backup.exe" /ST ' & GUICtrlRead($inputg1)
    Strings are set between single quotes ( ' ) and the executable path is set between double quotes ( " ) to have the quotes available in the string itself. With & strings are added together and $days is a variable that holds the days of the week to run the schedule, like the user has set it. @ScriptDir is the install- folder of MP2-Edit (and MP2-Backup) and with GUICtrlRead($inputg1) the given time to run the schedule is read from GUI.

    /Create is the option to create a new task. /RU is the user-account the new task should run at, /SC is the type of schedule (Weekly in this case), /D sets the Day(s) when the task should run (you can add one or more days here), /TN is the name to use for this task, /TR is the executable to run (MP2-Backup.exe) and /ST is the starting time for the task... So $option is holding the complete parameters for schtasks.exe

    And before the new schedule is created there is a /Delete run triggered to remove previous tasks with the same name.

    Here the schedule is working exactly as expected. The backup is running every day from task scheduler and keeps an eye on the number of backups to keep like adjusted in settings.
     

    breese

    Retired Team Member
  • Premium Supporter
  • July 11, 2011
    3,902
    770
    66
    Arlington Heights, Illinois
    Home Country
    United States of America United States of America
    I removed the one from Task Scheduler
    Went into MP2 and created a new one
    Then went back into Task Scheduler and exported the scheduled from MP2-Edit
    I am including it here and....
    Looks like your command it not adding the quotes

    </Settings>
    <Actions Context="Author">
    <Exec>
    <Command>C:\Program</Command>
    <Arguments>Files (x86)\Team MediaPortal\MP2-Edit\MP2-Backup.exe</Arguments>
    </Exec>
    </Actions>

    One more thing:
    Can you make the Exit of MP2-Edit starting backups an option?
    Seeing some of these DB files are going to get real big... might want to leave it to the user to decide
     

    Attachments

    • MP2-Backup.xml
      3.7 KB

    Lehmden

    Retired Team Member
  • Premium Supporter
  • December 17, 2010
    12,565
    3,946
    Lehmden
    Home Country
    Germany Germany
    Hi.
    Here is the command that is generated by MP2-Edit:

    C:\Windows\SysWOW64/schtasks.exe /Create /RU SYSTEM /SC WEEKLY /D Mon|Tue|Wed|Thu|Fri|Sat|Sun /TN MP2-Backup /TR "D:\Entwicklung\MP2-Edit\MP2-Backup.exe" /ST 19:00

    Maybe it is working as I ran it from my dev folder... But the quotes are definitely there. This has to be a bug in schtasks then...

    I will try to remove the quotes for testing and another thing I can try is to use single quotes. But if this did not help, I don't know what else to do...
     

    Lehmden

    Retired Team Member
  • Premium Supporter
  • December 17, 2010
    12,565
    3,946
    Lehmden
    Home Country
    Germany Germany
    Without quotes or with single quotes the schedule won't be created at all. So there is nothing I can do.
    But it looks like the schedule is created correct and only the export did not work...
    Zwischenablage-1.jpg


    If this definitely isn't working (need to test this some time) I must find a path for MP2-Backup without " " in, maybe C:\Windows or something like that. Or I probably can find an alternative to schtasks.exe also this is part of Windows and for this it should be usable...
     

    Users who are viewing this thread

    Top Bottom