• 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 Scheduled Task Result Output to File

Just use > redirection output to file in command of scheduled task.
 
Dear Igor,

I face an issue.

Schedule a Task / Run a command /

wget https://xxxxx/list.json -O /wp-content/uploads/files/attendee.json

reports an error : No such file or directory

The same error occurs with /var/www/vhosts/unidivers.fr/httpdocs/wp-content/uploads/files/attendee.json

Have you a fix ?

Thanks you,

Regards
 
Hi @NicolasUni . Please try
wget <source URL> -P <fully qualified directory path> -O <output filename>
for example
wget https://xxxxx/list.json -P /var/www/vhosts/<domain>/httpdocs/wp-content/uploads/files -O attendee.json
 
Dear Peter,

Unfortunatly, this command runs well with ssh but not within task Plesk scheduler…
Is there a way to create a routine by ssh, I mean to schedule a recursive task (like Plesk scheduler…), each day for instance ?

I would appreciate your kind help,

Best regards,
 
@NicolasUni this should work if as command in the Plesk scheduler.

wget https://example.com/list.json -P /httpdocs/wp-content/uploads/files

Edit: sorry, I just realized also want to rename the file.
 
Okay, I think I got it. I Tested this successfully in the Plesk scheduler:
wget -O httpdocs/wp-content/uploads/files/attendee.json https://example.com/list.json
 
Are you using the Scheduled Tasks option from the domain? Or from Tools & Settings > Scheduled Tasks?

Schermafbeelding 2023-02-25 130332.png
 
May be

wget -O /var/www/vhosts/MY-SITE/httpdocs/wp-content/uploads/files/attendee.json https://REMOTE-SITE/list.json
No, if you are running the scheduled task via Website & domains > Site dashboard > Scheduled Tasks then you don't need to include the full path, because the scheduled task runs from the home directory of the domain (system) user. But you can give it a try of course.

For me wget -O httpdocs/wp-content/uploads/files/attendee.json https://example.com/list.json works, when it test it.

The No such file or directory error indicates an issue with directory. Does the directory files actually exist?
 
Ok, I ve fixed permissions
But, always the same error than before :

Connecting to REMOTE-SERVER.. connected.
ERROR: The certificate of 'exemple.com' is not trusted.
ERROR: The certificate of 'exemple.com' doesn't have a known issuer.
 
Back
Top