• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

running ASP via scheduler

P

parser

Guest
How can i run asp file via scheduler?
when i try
D:\vhosts\vhosts\domain.com\httpdocs\aspfile.asp
is not run,
anybody?

Thanks
David
 
this sounds interesting for me too!
also with .net files (aspx).

Is it possible? and if so how?

Saludos
Pat
 
Asp scripts and scheduler

Yes it is possible with a trick.

You can trigger whatever script you want, even if it is no local, with the following code in php:
PHP:
if ($_GET['password']=='whatever')	{	
$CR = curl_init();					
curl_setopt($CR, CURLOPT_URL, "http://www.domain_name.com/what_ever_script.asp?parameter1=".$_GET['parameter1']);	
curl_setopt($CR, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($CR, CURLOPT_TIMEOUT, 60);
curl_setopt($CR, CURLOPT_POST, 1);
curl_setopt($CR, CURLOPT_POSTFIELDS, "parameter2=".$_GET['parameter2']);
curl_setopt($CR, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($CR, CURLOPT_SSL_VERIFYPEER, 0);
	
$result = curl_exec( $CR );
$error = curl_error( $CR );
	
if( !empty( $error )) {
curl_close( $CR );
echo 'Error:'.$error;
}
curl_close( $CR );
echo 'Ok:'.$result ;
}
Save the previous code as cronJob.php
At scheduler you define the following:

Script path:
c:\program files\swsoft\additional\php\php.exe
(or wherever the php.exe file at your plesk installation is...)

Parameters:
c:\full_server_path_to_file\cronJob.php password=whatever parameter1=value1 parameter2=value2part1+value2part2

Note that:
- Parameters are passed without being splitted with the & symbol (we use spaces instead), and each value must contain the + symbol in case of spaces
- php handles each parameter as a GET parameter
- you can pass parameters to the final script both through POST and GET methods.

CIao.
 
Back
Top