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.
Takeing backup from command Line.
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 50
- Joined: Mon Sep 25, 2006 11:18 pm
- Location: Chennai
- Contact:
-
- Premium Member
- Posts: 72
- Joined: Thu Sep 04, 2003 5:01 am
- Location: UK & Europe
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 - note that this is an executable and is meant to be run from the Windows client, not the UNIX server.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>