dbTalk Databases Forums  

Unix Sybase Q - possible to make Backup server have a daily log file, without manual restart?

comp.databases.sybase comp.databases.sybase


Discuss Unix Sybase Q - possible to make Backup server have a daily log file, without manual restart? in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tom Brehony
 
Posts: n/a

Default Unix Sybase Q - possible to make Backup server have a daily log file, without manual restart? - 08-03-2004 , 04:59 AM






I have a Sybase server (11.5.1) running under AIX 4.2.1.

I have changed the backup servers start script to output to a log file which
corresponds
to the days date.

Example snip from RUN_SYB_BACKUP file:
-e/log/SYB_BACKUP.backup.log.`date +%d-%m-%C%y`

If I restarted my backup server today it's logfile would have the following
name.
SYB_BACKUP.backup.log.03-08-2004

While this means that if the backup server is restarted on different days,
it leaves
seperate log files behind it. The disadvantage here is that the log file
name is defined
at server startup time.

I would like to have the backup server write to daily log files
automatically without
having to restart the server manually.

Anyone know if this is even possible?

Tom.




Reply With Quote
  #2  
Old   
Larry Coon
 
Posts: n/a

Default Re: Unix Sybase Q - possible to make Backup server have a daily log file, without manual restart? - 08-03-2004 , 12:17 PM






Tom Brehony wrote:

Quote:
I would like to have the backup server write to daily log files
automatically without
having to restart the server manually.

Anyone know if this is even possible?
Have a cron job do it. Have it run daily, and copy the
log file to an appropriately namned (with the date) file,
then clear out the log file.


Larry Coon
University of California


Reply With Quote
  #3  
Old   
Sara Law
 
Posts: n/a

Default Re: Unix Sybase Q - possible to make Backup server have a daily log file, without manual restart? - 08-03-2004 , 01:35 PM



Hmmm ... interesting question, Tom. You can do the following ...

1 - "cp" the log file once per day to a daily version.
2 - cat the active log file like so: "cat Your.log | sed 'd' >
Your.log"

This clears out the file (0 bytes) and the next backup will write to
it just fine ... I tested this on Solaris but it should work on any
UNIX flav ...

Cheers!

Sara ...

"Tom Brehony" <tombrehony.nospam (AT) eircom (DOT) nospam.net> wrote

Quote:
I have a Sybase server (11.5.1) running under AIX 4.2.1.

I have changed the backup servers start script to output to a log file which
corresponds
to the days date.

Example snip from RUN_SYB_BACKUP file:
-e/log/SYB_BACKUP.backup.log.`date +%d-%m-%C%y`

If I restarted my backup server today it's logfile would have the following
name.
SYB_BACKUP.backup.log.03-08-2004

While this means that if the backup server is restarted on different days,
it leaves
seperate log files behind it. The disadvantage here is that the log file
name is defined
at server startup time.

I would like to have the backup server write to daily log files
automatically without
having to restart the server manually.

Anyone know if this is even possible?

Tom.

Reply With Quote
  #4  
Old   
Tom Brehony
 
Posts: n/a

Default Re: Unix Sybase Q - possible to make Backup server have a daily log file, without manual restart? - 08-06-2004 , 02:56 AM



I tried this and it works. Thanks Sara and Larry!

Tom.

"Sara Law" <saradba (AT) hotmail (DOT) com> wrote

Quote:
Hmmm ... interesting question, Tom. You can do the following ...

1 - "cp" the log file once per day to a daily version.
2 - cat the active log file like so: "cat Your.log | sed 'd'
Your.log"

This clears out the file (0 bytes) and the next backup will write to
it just fine ... I tested this on Solaris but it should work on any
UNIX flav ...

Cheers!

Sara ...

"Tom Brehony" <tombrehony.nospam (AT) eircom (DOT) nospam.net> wrote

I have a Sybase server (11.5.1) running under AIX 4.2.1.

I have changed the backup servers start script to output to a log file
which
corresponds
to the days date.

Example snip from RUN_SYB_BACKUP file:
-e/log/SYB_BACKUP.backup.log.`date +%d-%m-%C%y`

If I restarted my backup server today it's logfile would have the
following
name.
SYB_BACKUP.backup.log.03-08-2004

While this means that if the backup server is restarted on different
days,
it leaves
seperate log files behind it. The disadvantage here is that the log file
name is defined
at server startup time.

I would like to have the backup server write to daily log files
automatically without
having to restart the server manually.

Anyone know if this is even possible?

Tom.



Reply With Quote
  #5  
Old   
Pablo Sanchez
 
Posts: n/a

Default Re: Unix Sybase Q - possible to make Backup server have a daily log file, without manual restart? - 08-06-2004 , 07:41 AM



"Tom Brehony" <tombrehony.nospam (AT) eircom (DOT) nospam.net> wrote in
news:2ngrubFoi7pU1 (AT) uni-berlin (DOT) de:

Quote:
I tried this and it works. Thanks Sara and Larry!

"Sara Law" <saradba (AT) hotmail (DOT) com> wrote in message
news:b67ab85d.0408031035.4d08a75d (AT) posting (DOT) google.com...
Hmmm ... interesting question, Tom. You can do the following ...

1 - "cp" the log file once per day to a daily version.
2 - cat the active log file like so: "cat Your.log | sed 'd'
Your.log"

This clears out the file (0 bytes) and the next backup will write
to it just fine ... I tested this on Solaris but it should work
on any UNIX flav ...
A slight optimization to Sara's solution:

echo > Your.log

will have the same effect as the cat/sed combination but will be
substantially faster on large files.

Regards,
--
Pablo Sanchez - Blueoak Database Engineering, Inc
http://www.blueoakdb.com


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.