• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved java command works from SSh Terminal but not from Plesk task scheduler

sweetman

Basic Pleskian
Server operating system version
CentOS 7.9
Plesk version and microupdate number
Plesk Obsidian 18.0.44 update #3
Hello all,
I can run succesfully a command line from SSH Terminal in the my Plesk Subscription.
But the same command, in Plesk Scheduler (in the same subscription) doesn't work.
Why?
Please keep in mind that the command will require one or two hours to complete.

Here is the command (simplified):
java -jar httpdocs/connector/Content.jar datasource httpdocs/connector/configuration/Content.xml import

The only difference here are paths:
when I run the command line, before running it, I change the path to the folder containing the script (cd httpdocs/connector/);
then I run the script:

java -jar Content.jar datasource configuration/Content.xml import

This way it works.

In the Plesk Scheduler I created the command including the path to the script to run:
java -jar httpdocs/connector/Content.jar datasource httpdocs/connector/configuration/Content.xml import
When I run the task, I get the pop up saying it has completed succesfully in 1 second and nothing else.

Can I create a batch file the same way as the old MS-DOS and execute it? This way I would use the same commands I would use with the command line. Something like:
MYBATCH.SH
cd httpdocs/connector/
java -jar Content.jar datasource configuration/Content.xml import


Then in Task scheduler I would run this file.

Is this possibile?
TIA
tony
 
Perhaps i solved.
The shell script file command seems to work.
Since the script takes hours to complete, it's safe to close the browser while it is running? (see attahcment)
TIA
Tony
 

Attachments

  • running task.png
    running task.png
    5.5 KB · Views: 3
Perhaps i solved.
The shell script file command seems to work.
Since the script takes hours to complete, it's safe to close the browser while it is running? (see attahcment)
TIA
Tony
I answer myself: yes. The script will continue running even if you close the browser completely.
If you get back to the same page you'll see the same pop up (if the script is still running).
Tony
 
Back
Top