I am trying to setup this scheduled task, but I can't get it running correctly in Plesk "Scheduled Tasks".
The Command line I want to run is this:
C:\Program Files (x86)\JAM Software\SpamAssassin for Windows\sa-update.exe -v --nogpg --channelfile UpdateChannels.txt
I tried this in Path to executable file:
C:\Program Files (x86)\JAM Software\SpamAssassin for Windows\sa-update.exe -v --nogpg --channelfile UpdateChannels.txt
But I got error:
Failed with error: 'C:\Program Files (x86)\JAM Software\SpamAssassin for Windows\sa-update.exe -v --nogpg --channelfile UpdateChannels.txt' is not recognized as an internal or external command, operable program or batch file.
------------------
So I tried separating the arguments and tried this in Path to executable file:
C:\Program Files (x86)\JAM Software\SpamAssassin for Windows\sa-update.exe
Arguments:
-v --nogpg --channelfile UpdateChannels.txt
I got "Output" Error:
cannot open UpdateChannels.txt for reading: No such file or directory
-------------------
So I tried adding the full path to the argument filename and tried this in Path to executable file:
C:\Program Files (x86)\JAM Software\SpamAssassin for Windows\sa-update.exe
Arguments:
-v --nogpg --channelfile "C:\Program Files (x86)\JAM Software\SpamAssassin for Windows\UpdateChannels.txt"
I got "Output" error:
Update available for channel updates.spamassassin.org: -1 -> 1691495
config: no configuration text or files found! do you need to run 'sa-update'?
Timeout::_run: check: no loaded plugin implements 'check_main': cannot scan!
Check the necessary '.pre' files are in the config directory.
The problem seems to be that when plesk runs the executable, it's not setting the "Start In" path to the path of the executable, so when the executable runs and tries to look for files in the same path as itself, it can't find them because the "Start In" path is not set properly by Plesk.
What I mean by the "Start In" path is the same like when you are editing a windows shortcut, it has a "Start In" path setting in the LNK file settings. This is the "default" path that the executable will look in for other files. If you don't specify a "Start In" path in a windows shortcut, then the executable might not work properly if it tries to find additional files where the executable is located.
The fact that I got the "cannot open UpdateChannels.txt for reading: No such file or directory" just proves my point because the executable was not able to find the file "UpdateChannels.txt" even though it is located in the SAME directory as the sa-update.exe file. For the sa-update.exe file to not find the UpdateChannels.txt file located in the same directory, just means that "Start in" path was not set to the same path as the exe file.
So, how can I get the above scheduled task running properly?
The Command line I want to run is this:
C:\Program Files (x86)\JAM Software\SpamAssassin for Windows\sa-update.exe -v --nogpg --channelfile UpdateChannels.txt
I tried this in Path to executable file:
C:\Program Files (x86)\JAM Software\SpamAssassin for Windows\sa-update.exe -v --nogpg --channelfile UpdateChannels.txt
But I got error:
Failed with error: 'C:\Program Files (x86)\JAM Software\SpamAssassin for Windows\sa-update.exe -v --nogpg --channelfile UpdateChannels.txt' is not recognized as an internal or external command, operable program or batch file.
------------------
So I tried separating the arguments and tried this in Path to executable file:
C:\Program Files (x86)\JAM Software\SpamAssassin for Windows\sa-update.exe
Arguments:
-v --nogpg --channelfile UpdateChannels.txt
I got "Output" Error:
cannot open UpdateChannels.txt for reading: No such file or directory
-------------------
So I tried adding the full path to the argument filename and tried this in Path to executable file:
C:\Program Files (x86)\JAM Software\SpamAssassin for Windows\sa-update.exe
Arguments:
-v --nogpg --channelfile "C:\Program Files (x86)\JAM Software\SpamAssassin for Windows\UpdateChannels.txt"
I got "Output" error:
Update available for channel updates.spamassassin.org: -1 -> 1691495
config: no configuration text or files found! do you need to run 'sa-update'?
Timeout::_run: check: no loaded plugin implements 'check_main': cannot scan!
Check the necessary '.pre' files are in the config directory.
The problem seems to be that when plesk runs the executable, it's not setting the "Start In" path to the path of the executable, so when the executable runs and tries to look for files in the same path as itself, it can't find them because the "Start In" path is not set properly by Plesk.
What I mean by the "Start In" path is the same like when you are editing a windows shortcut, it has a "Start In" path setting in the LNK file settings. This is the "default" path that the executable will look in for other files. If you don't specify a "Start In" path in a windows shortcut, then the executable might not work properly if it tries to find additional files where the executable is located.
The fact that I got the "cannot open UpdateChannels.txt for reading: No such file or directory" just proves my point because the executable was not able to find the file "UpdateChannels.txt" even though it is located in the SAME directory as the sa-update.exe file. For the sa-update.exe file to not find the UpdateChannels.txt file located in the same directory, just means that "Start in" path was not set to the same path as the exe file.
So, how can I get the above scheduled task running properly?