Page 1 of 1

how to take the back up the log files for n days

Posted: Thu Apr 06, 2006 4:28 am
by sudhakar_viswa
Hi,

how to take the back up the log files for n days

thanks,
sudhakar

Posted: Thu Apr 06, 2006 4:37 am
by loveojha2
This query may help you

Code: Select all

SELECT TIMESTAMP FROM RT_LOGnn WHERE TIMESTAMP >='1900-01-01' AND TIMESTAMP<='2006-01-01'
Where nn is the jobnumber.

Posted: Thu Apr 06, 2006 6:48 am
by chulett
Better to take the 'dsjob' approach as it is more 'future proof'. IMHO.

Posted: Thu Apr 06, 2006 7:24 am
by sudhakar_viswa
hi loveojha2 ,

how can i execute this Code in unix

SELECT TIMESTAMP FROM RT_LOGnn WHERE TIMESTAMP >='1900-01-01' AND TIMESTAMP<='2006-01-01'

thanks,sudhakar

Posted: Thu Apr 06, 2006 7:38 am
by ArndW
You cannot, this is a command that needs to be executed in TCL or from the ADMINistrator command.

Posted: Thu Apr 06, 2006 4:10 pm
by ray.wurlod
You can, by invoking TCL from the command line.

Code: Select all

cd project_dir && . $DSHOME/dsenv && $DSHOME/bin/dssh "SELECT * FROM RT_LOGnn WHERE TIMESTAMP BETWEEN '2006-04-01' AND '2006-04-05';"
But, as Arnd suggests, this is not future proof. In the next release ("Hawk"), job logs are not stored in this fashion.

Posted: Fri Apr 07, 2006 2:48 am
by sudhakar_viswa
Hi ray.wurlod and ArndW ,

Thanku.I want to store the result in unix file.how can i do that.


thanks,
sudhakar

Posted: Fri Apr 07, 2006 3:05 am
by ArndW
how about a command like dsjob -logsum MyProjectName MyJobName > MyUnixTextFileName.txt from UNIX.

Posted: Fri Apr 07, 2006 5:18 am
by sudhakar_viswa
hi ArndW ,

i want to execute this query in unix
SELECT TIMESTAMP FROM RT_LOGnn WHERE TIMESTAMP >='1900-01-01' AND TIMESTAMP<='2006-01-01'

and i should store this result into one text file in unix.

how to do that?

thanks,
sudhakar

Posted: Fri Apr 07, 2006 3:58 pm
by ray.wurlod
Simply redirect output into your file using the ">" redirection operator.

Note, however, that SQL can not be executed from UNIX, no matter how much you may want to do so, because UNIX is not a database environment. You need some kind of wrapper, such as exemplified in earlier posts.