Takeing backup from command Line.

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
nilesh
Participant
Posts: 17
Joined: Tue Aug 08, 2006 5:02 am
Location: Mumbai

Takeing backup from command Line.

Post 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.
ragunathan13
Participant
Posts: 50
Joined: Mon Sep 25, 2006 11:18 pm
Location: Chennai
Contact:

Post by ragunathan13 »

Hi..

Use this command "dscmdexport.exe" in command prompt and give the needed parameters.
SettValleyConsulting
Premium Member
Premium Member
Posts: 72
Joined: Thu Sep 04, 2003 5:01 am
Location: UK & Europe

Post 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
nilesh
Participant
Posts: 17
Joined: Tue Aug 08, 2006 5:02 am
Location: Mumbai

Post 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
Nilesh Malekar
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Nilesh - note that this is an executable and is meant to be run from the Windows client, not the UNIX server.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post 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.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply