Managing Virtual Portals > Running an Antivirus Scan to Rescan Files
Running an Antivirus Scan to Rescan Files
This procedure is applicable to the global administration portal only.
Scans all the files in all the virtual portals for viruses. This scan checks all the files, both new files and files that were previously scanned.
The API can be included in a script, to schedule rescans. For example, if the antivirus software release updates once a month, the rescan can also be scheduled for once a month, after the antivirus software is updated.
Note: The scan can take a long time, depending on the amount of data in your portal.
The following conditions apply to scanning files:
*If a background scan has a file to scan when a rescan is initiated, the background scan completes before the rescan proceeds and the files scanned by the background scan are not rescanned.
*Renaming a folder is treated as if the folder and the files in the folder are new. During a background scan the files in the folder are scanned first.
API
admin/api/servers
URI
https://portal_url/admin/api/servers
where portal_url is the URL of the portal to login to. CTERA recommends using HTTPS and not HTTP.
method
POST
Request Content-Type
application/x-www-form-urlencoded or text/xml
Request body
<obj>
  <att id="type">
    <val>user-defined</val>
  </att>
  <att id="name">
    <val>resetAllAVBG</val>
  </att>
</obj>
Expected Response status
200 OK and a HTTP session cookie which is then used for the duration of the session.
If a response such as 403 Forbidden is returned, check the user name and password provided.
cURL example
curl -X HEAD -i -v -b cookie-jar -H "Content-Type: application/xml" -d '<obj><att id="type"><val>user-defined</val></att><att id="name"><val>resetAllAVBG</val></att></obj>' -X POST "https://"$host"/admin/api/servers/"
Example Script
#!/bin/bash
# USAGE: ./script.sh portal_URL user_name user_password
# example: ./script.sh portal.ctera.me adminuser adminpassword
clear
host=$1
user=$2
pass=$3
 
#login
curl -X HEAD -i -c cookie-jar -H "Content-Type: text/xml" -X POST "https://"$host"/admin/api/login?j_username="$user"&j_password="$pass""
 
#Start rescan
resp=$(curl -X HEAD -i -v -b cookie-jar -H "Content-Type: application/xml" -d '<obj><att id="type"><val>user-defined</val></att><att id="name"><val>resetAllAVBG</val></att></obj>' -X POST "https://"$host"/admin/api/servers/")
echo "$resp"