Perl Script Errors: pdm_clean_attachments.pl
search cancel

Perl Script Errors: pdm_clean_attachments.pl

book

Article ID: 217029

calendar_today

Updated On:

Products

CA Service Management - Service Desk Manager CA Service Desk Manager

Issue/Introduction

When trying to use the pdm_clean_attachments.pl script to delete orphan attachments in the Service Desk repository.

Running the script with the "-S" switch 

perl pdm_clean_attachments.pl -S

Provides this error:

"There are no Service Desk repositories in the MDB"...

Trying to reference the Service Desk repository by name using the "-n" switch

perl pdm_clean_attachments.pl -n

provides the following error:

"The specified repository is not found in the MDB".

Environment

Release : 17.1

Component : SERVICE DESK MANAGER

Cause

The server name is not defined within the script.

Resolution

Added the server name to the following line in the script:

# Select all repositories, but then
    # maybe only process active repositories??
    #$cmd .= " WHERE del=0 AND server = '";

    $cmd .= " WHERE server = <SERVERNAME>'";
    $cmd .= " WHERE server = '";
    $cmd .= $hostname;
    $cmd .= "'";
    $cmd .= " ORDER BY upload_path, repository_type";
    $cmd .= "\" ";
    $cmd .= $redirect_stderr;

Additional Information

Default Script Location:

C:\Program Files (x86)\CA\Service Desk Manager\bin

Working copy attached to this KB.

Replace YOUR_SERVER_NAME_HERE appropriately. 

Attachments

1623334517469__pdm_clean_attachments.pl get_app