Video Screencast Help

File to download JDB files for SEM

Created: 01 May 2009 • Updated: 04 May 2009 | 10 comments
ShadowsPapa's picture
+4 6 Votes
Login to vote

If you have used SAV CE, you probably also knew about the XDBDOWN.CMD file to download the XDB definitions updates for SAV CE. You could use it to automatically download the latest QA'd defs or rapid release if so inclined by simply changing a 0 to a 1 in the script.
I've modified it for use with SEP's manager. It will download JDB files for use with SEP, and if so inclined, download the RR defs - which is what this example is set to do.
If you want QA defs, change the rapid release =  line from 1 to 0 and save it.
I run this from a C:\WORK folder on the server. You can manually run it, or schedule it with task scheduler. Nice to have in emergencies where perhaps you have caught a NEW virus or variant, and need the RR defs fast and don't want to have to manually figure out what to get and where to place it.
Just create a shortcut to this script and next emergency, run it and your SEM server will get the latest rapid release definitions.

Here is the script text, I thnk I can attach the file here, too......... save the attached file as JDBDown.cmd as all this allows is txt attachments, etc. for security reasons.
If you copy and paste the below lines, paste in notepad and NO wordwrap, save as jdbdown.cmd

@Set COPY_jdb_TO="C:\Program Files\Symantec\Symantec Endpoint Protection Manager\data\inbox\content\incoming"
@set RAPIDRELEASE=1
@set jdbTEMP=%temp%

@rem ==============================================================================================
@rem Set RAPIDRELEASE=1 to download repidrelease definitions, RAPIDRELEASE=0 for fully QA'd definitions (standard).
@rem Change COPY_jdb_TO= to point to the SEP server directory (or where you want the jdb file copied)
@rem you can also run the script directly from the SEP incoming folder and it will copy the definitions there.
@rem jdbTEMP is the temp folder the script will use while downloading definitions, set to %temp% to use system default
@rem ==============================================================================================
@rem Script for downloading virus and spyware definition updates for
@rem Symantec Endpoint Protection version 11.xx
@rem ==============================================================================================
@echo off

rem ========= check that OS is win2k or better ============
if not "%OS%" == "Windows_NT" goto BADOS
if "%APPDATA%" == "" goto BADOS

rem ========= make sure to be in script directory ============
if exist rtvscan.exe set COPY_jdb_TO=%CD%
for %%i in (%0) do @%%~di
for %%i in (%0) do @cd %%~pi
if exist rtvscan.exe set COPY_jdb_TO=%CD%

rem =========== get name/size of last file from "jdbdown.lastfile" ============
if not exist jdbdown.lastfile goto NOLAST
for /f "tokens=1" %%f in (jdbdown.lastfile) do set lastfile=%%f
for /f "tokens=2" %%f in (jdbdown.lastfile) do set lastsize=%%f
:NOLAST

rem ========= jump to temp dir ============
if not exist "%jdbTEMP%\jdbtmp" md "%jdbTEMP%\jdbtmp"
if exist "%jdbTEMP%\jdbtmp\*.jdb" del "%jdbTEMP%\jdbtmp\*.jdb"
pushd "%jdbTEMP%\jdbtmp"

rem =========== make ftp script for checking jdb directory on ftp ===========
echo open ftp.symantec.com> check.txt
echo anonymous>> check.txt
echo email@address.com>> check.txt
set jdbfolder=jdb
if "%RAPIDRELEASE%" == "1" set jdbfolder=rapidrelease
echo cd /public/english_us_canada/antivirus_definitions/symantec_antivirus_corp/%jdbfolder%>> check.txt
echo dir *.jdb chk.lst>> check.txt
echo bye>> check.txt

rem =========== get filename and size from ftp ============
if exist chk.lst del chk.lst
ftp -s:check.txt
if not exist chk.lst goto ERROR
for /f "tokens=9" %%f in (chk.lst) do set jdbfile=%%f
for /f "tokens=5" %%f in (chk.lst) do set jdbsize=%%f
if "%jdbfile%" == "" goto ERROR
if "%jdbsize%" == "" goto ERROR

rem =========== compare ftp name/size to local ============
if not "%jdbfile%" == "%lastfile%" goto DOWNLOAD
if not "%jdbsize%" == "%lastsize%" goto DOWNLOAD
popd
echo.
echo Already downloaded latest %jdbfolder% file: %jdbfile% - size %jdbsize%
echo %date% %time% Already downloaded latest %jdbfolder% file: %jdbfile% - size %jdbsize% >> jdbdown.log
goto END

:DOWNLOAD
rem ========= make ftp script for downloading new jdb file =========
echo open ftp.symantec.com> down.txt
echo anonymous>> down.txt
echo email@address.com>> down.txt
echo cd public/english_us_canada/antivirus_definitions/norton_antivirus/%jdbfolder%>> down.txt
echo bin>> down.txt
echo hash>> down.txt
echo get %jdbfile%>> down.txt
echo bye>> down.txt

rem ============= download new file =================
ftp -s:down.txt
for %%i in (%jdbfile%) do @set newsize=%%~zi
if not "%newsize%" == "%jdbsize%" goto ERROR
move %jdbfile% %COPY_jdb_TO%
if exist %jdbfile% goto ERRORMOVE
popd
echo.
echo %jdbfile% %jdbsize% > jdbdown.lastfile
echo Downloaded new %jdbfolder% file: %jdbfile% - size %jdbsize%
echo %date% %time% Downloaded new %jdbfolder% file: %jdbfile% - size %jdbsize% >> jdbdown.log
goto END

:ERROR
popd
echo.
echo ERROR: problem downloading %jdbfolder% definition file. jdbfile=%jdbfile% jdbsize=%jdbsize% newsize=%newsize% (lastfile=%lastfile% lastsize=%lastsize%).
echo %date% %time% ERROR: problem downloading %jdbfolder% definition file. jdbfile=%jdbfile% jdbsize=%jdbsize% newsize=%newsize% (lastfile=%lastfile% lastsize=%lastsize%). >> jdbdown.log
type "%jdbTEMP%\jdbtmp\chk.lst" >> jdbdown.log
echo. >> jdbdown.log
goto END

:ERRORMOVE
popd
echo.
echo ERROR: problem moving definition file to SAV folder. COPY_jdb_TO=%COPY_jdb_TO% newsize=%newsize% (lastfile=%lastfile% lastsize=%lastsize%).
echo %date% %time% ERROR: problem moving definition file to SAV folder. COPY_jdb_TO=%COPY_jdb_TO% newsize=%newsize% (lastfile=%lastfile% lastsize=%lastsize%). >> jdbdown.log
goto END

:BADOS
echo.
echo ERROR: this script needs Windows 2000 or better.
echo %date% %time% ERROR: this script needs Windows 2000 or better. >> jdbdown.log
goto END

:END
if exist "%jdbTEMP%\jdbtmp\check.txt" del "%jdbTEMP%\jdbtmp\check.txt"
if exist "%jdbTEMP%\jdbtmp\down.txt" del "%jdbTEMP%\jdbtmp\down.txt"
if exist "%jdbTEMP%\jdbtmp\chk.lst" del "%jdbTEMP%\jdbtmp\chk.lst"
rd "%jdbTEMP%\jdbtmp"
set COPY_jdb_TO=
set RAPIDRELEASE=
set lastsize=
set lastfile=
set newsize=
set jdbsize=
set jdbfile=
set jdbfolder=
set jdbtemp=
 

Comments 10 CommentsJump to latest comment

windessy's picture

Good script.
but may need correction, if SEP installed not in default directory.

Невозможно жить в обществе без чёткой цветовой дифференциации штанов (С)

0
Login to vote
ajeet kumar's picture

Hi,
Can i change the default location to save jdb file. because i installed SEPM for intranet envorinment & there is no internet connection.
i am downloading .jdb file from another internet pc.

+1
Login to vote
ShadowsPapa's picture

Good points - IF you didn't install to the default C drive location, you'll need to change the path the file gets copied to or placed into.
That's done in the top line.

Can do the same if using one computer to download, and it's getting placed onto another computer. In that case might map a network drive to the destination computer to simplify things...........
It's pretty secure then..

+1
Login to vote
Ajju's picture

Hi Ajeet,

You cannot run the script on the intranet system.  This is designed to run on the system having internet.

If you wish to download the jdb thru script, run the script in the internet system and copy it to the intranet system.

0
Login to vote
ajeet kumar's picture

Hi
I am doing same steps.

+1
Login to vote
soheilspeedart's picture

hi
sorry but i can not write English well,  u can help me in simple english?

i use sep 11 mr4 in win 7 rc

when i download JDB file, i must copy this file to "C:\Program Files\Symantec\Symantec Endpoint Protection Manager\data\inbox\content\incoming"   ok?   but i can not find this path in my defult  installation !!!

sep install automaticlly in E:\Program Files\Symantec\Symantec Endpoint Protection and i have not "C:\Program Files\Symantec\Symantec Endpoint Protection Manager\data\inbox\content\incoming"  !!!!!

PLZ help me   

i must copy this JDB file in what path?

0
Login to vote
ajeet kumar's picture

open this script in notepad and change the path c: to e:

Set COPY_jdb_TO="e:\Program Files\Symantec\Symantec Endpoint Protection Manager\data\inbox\content\incoming"

then run the script.

0
Login to vote
soheilspeedart's picture

tanks but i can not underestand!!!

i must what do?

0
Login to vote
ajeet kumar's picture

change the drive letter in script from c: drive to e: drive

+1
Login to vote
soheilspeedart's picture

i dont now that what is Script!!!!

plz very simple  step by step!!!

for Example
1) save      Set COPY_jdb_TO="e:\Program Files\Symantec\Symantec Endpoint Protection Manager\data\inbox\content\incoming"   to a text file
2) change in to name .....
3) copy it to path .....
4) run it in path .....
......

sorry and tanks

0
Login to vote