Page 1 of 1

Takeing backup from command Line.

Posted: Tue Feb 06, 2007 6:07 am
by nilesh
Hi,

Can anybody tell me how to take a backup from command line? I am useing datastage server edtion and O.S. is AIX V.5.

Thanks in advance.
Nilesh.

Posted: Tue Feb 06, 2007 6:28 am
by ragunathan13
Hi..

Use this command "dscmdexport.exe" in command prompt and give the needed parameters.

Posted: Tue Feb 06, 2007 7:47 am
by SettValleyConsulting
This may be OTT for your needs but here is a VBScript to export a project. You could just extract the parts that do the export into a bacth file.

Code: Select all


'*
'* DSPExport'
'*
'* 
'* Script to export a Datastage Project.
'* 
'* Export filename is named after Project + Date
'*
'* Phil Clarke. June 2005.
'*
'* 
'*        Arguments: 1 Server Name
'*                   2 Username
'*                   3 Password
'*                   4 Project Name
'*                   5 Path to write the export to.
'*

Dim Server
Dim User
Dim Password
Dim Project
Dim SavePath

Call Main

Sub Main()

Dim dsxFileName
Dim TmpFilename
Dim TmpFolder
Dim cmdline
Dim objShell
Dim ReturnCode
Dim args
Dim fso

  ' Store Arguments
  
  Server = wscript.Arguments.item(0) & ":31539"
  User = wscript.Arguments.item(1)
  Password = wscript.Arguments.item(2)
  Project = wscript.Arguments.item(3)
  SavePath = wscript.Arguments.item(4)

  dsxFileName = Project & "_" & YEAR(Date()) & "_" & Pd(Month(date()),2) & "_" & Pd(DAY(date()),2) & ".dsx"


  wscript.echo("  ")
  wscript.echo("Datastage Export")
  wscript.echo("  ")
  wscript.echo("Server      " & Server)
  wscript.echo("Project     " & Project)
  wscript.echo("Export File " & dsxFilename)
  wscript.echo("  ")

' Instantiate Shell & file system objects

  Set fso = CreateObject("Scripting.FileSystemObject")
  set objShell = CreateObject("Wscript.Shell")

' Generate a file name based on project + date 

  TmpFolder = fso.GetSpecialFolder(2)
  TmpFilename = TmpFolder & "\" & dsxFileName
  
' Run the export to a temporary file

  wscript.echo("Exporting to " & TmpFilename & "...")

  args = " /H=" & Server & " /U=" & User & " /P=" & Password & " " & Project  & " " & TmpFilename  
  objshell.CurrentDirectory = "C:\Program Files\Ascential\DataStage 7.5.1\"
  cmdline = "dscmdexport.exe " & args
  
  returnCode = objshell.run(cmdline,1,true)
  
  ' Move from temp file to final resting place
    
  wscript.echo("Copying to " & SavePath & "...")
  fso.CopyFile TmpFilename, SavePath 

      
End Sub

Function pd(n, totalDigits) 

if totalDigits > len(n) then 
 pd = String(totalDigits-len(n),"0") & n 
else 
 pd = n 
end if End Function

Posted: Wed Feb 07, 2007 5:16 am
by nilesh
Will this command(dscmdexport.exe) run from shell prompt?

If so from where should i execute? I mean to say should i use this path
/home/dsadm/Ascential/DataStage/DSEngine/bin?

Please help me out.

Thanks in advance.
Nilesh

Posted: Wed Feb 07, 2007 5:21 am
by ArndW
Nilesh - note that this is an executable and is meant to be run from the Windows client, not the UNIX server.

Posted: Wed Feb 07, 2007 5:31 am
by kumar_s
DSExport.exe and dscmdexport.exe both are client component. I dont think we have an option to export from Unix server side.