Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

ASA Backup Event Create Directory

3 posts in General Discussion Last posting was on 2003-04-07 19:22:20.0Z
Doug Stone Posted on 2003-04-03 23:53:41.0Z
From: "Doug Stone" <nospamdstone@res-q.com>
Subject: ASA Backup Event Create Directory
Date: Thu, 3 Apr 2003 15:53:41 -0800
Lines: 51
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Message-ID: <#TBjzxj#CHA.317@forums-1-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: adsl-64-164-175-77.dsl.lsan03.pacbell.net 64.164.175.77
Path: forums-1-dub!forums-master.sybase.com!forums-1-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:860
Article PK: 4021

Hi. Does anyone know if the directory specified in a backup event will be
created if it does not already exist?
I think that sometimes the event has created directories; other times
nothing happens--no directory, no error message.

Here's the event:

CREATE EVENT rfwDailyBackup
SCHEDULE daily_backup
start time '11:00 PM' every 24 hours
HANDLER
BEGIN
DECLARE day_of_week VARCHAR(9);
SELECT dayname (today()) INTO day_of_week;
CASE day_of_week
WHEN 'Monday' then
backup database directory 'c:\\rfw\\backups\\Mon'
transaction log only
transaction log truncate
WHEN 'Tuesday' then
backup database directory 'c:\\rfw\\backups\\Tue'
transaction log only
transaction log truncate
WHEN 'Wednesday' then
backup database directory 'c:\\rfw\\backups\\Wed'
transaction log only
transaction log truncate
WHEN 'Thursday' then
backup database directory 'c:\\rfw\\backups\\Thu'
transaction log only
transaction log truncate
WHEN 'Friday' then
backup database directory 'c:\\rfw\\backups\\Fri'
transaction log only
transaction log truncate
WHEN 'Saturday' then
backup database directory 'c:\\rfw\\backups\\Sat'
transaction log only
transaction log truncate
WHEN 'Sunday' then
backup database directory 'c:\\rfw\\backups\\Sun_Full_Backup'
transaction log truncate
ELSE
Return
END CASE;
END

Thank you,
Doug


Nick Elson Posted on 2003-04-04 15:27:44.0Z
From: "Nick Elson" <no_spam_nicelson@sybase.com>
References: <#TBjzxj#CHA.317@forums-1-dub>
Subject: Re: ASA Backup Event Create Directory
Date: Fri, 4 Apr 2003 10:27:44 -0500
Lines: 92
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <uh97X8r#CHA.68@forums-1-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: vpn-dub-071.sybase.com 10.22.120.71
Path: forums-1-dub!forums-master.sybase.com!forums-1-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:861
Article PK: 2771

From my experience (and just now testing it in 8.0.2)
ASA and utilities will tend to create a leaf directory
for you but will not do so for full paths (when internal
tree directories are also missing).

In the case of this statement

backup database directory 'c:\\temp\\backups\\Friday'

that works if there is a subtree for

c:\temp\backups

in existance alreaedy but not if the directory backups is
missing too.

If it helps you could for the tree heirarchy to always exists
by coding this into a start database event script using the
xp_cmdshell as in:

create event StartupNSetup_Event
type DatabaseStart Enable
Handler
begin
. . . .
xp_cmdshell ('md c:\\rfw' , 'no_output' );
xp_cmdshell ('md c:\\rfw\\backups', 'no_output' );
xp_cmdshell ('md c:\\rfw\\backups\Mon', 'no_output' );
. . . .
xp_cmdshell ('md c:\\rfw\\backups\Sat', 'no_output' );
xp_cmdshell ('md c:\\rfw\\backups\Sun_Full_Backup', 'no_output' )';
. . . .
end

That way you'll have full control over this, an autosetup feature,
and minimum overhead.

"Doug Stone" <nospamdstone@res-q.com> wrote in message
news:#TBjzxj#CHA.317@forums-1-dub...
> Hi. Does anyone know if the directory specified in a backup event will be
> created if it does not already exist?
> I think that sometimes the event has created directories; other times
> nothing happens--no directory, no error message.
>
> Here's the event:
>
> CREATE EVENT rfwDailyBackup
> SCHEDULE daily_backup
> start time '11:00 PM' every 24 hours
> HANDLER
> BEGIN
> DECLARE day_of_week VARCHAR(9);
> SELECT dayname (today()) INTO day_of_week;
> CASE day_of_week
> WHEN 'Monday' then
> backup database directory 'c:\\rfw\\backups\\Mon'
> transaction log only
> transaction log truncate
> WHEN 'Tuesday' then
> backup database directory 'c:\\rfw\\backups\\Tue'
> transaction log only
> transaction log truncate
> WHEN 'Wednesday' then
> backup database directory 'c:\\rfw\\backups\\Wed'
> transaction log only
> transaction log truncate
> WHEN 'Thursday' then
> backup database directory 'c:\\rfw\\backups\\Thu'
> transaction log only
> transaction log truncate
> WHEN 'Friday' then
> backup database directory 'c:\\rfw\\backups\\Fri'
> transaction log only
> transaction log truncate
> WHEN 'Saturday' then
> backup database directory 'c:\\rfw\\backups\\Sat'
> transaction log only
> transaction log truncate
> WHEN 'Sunday' then
> backup database directory 'c:\\rfw\\backups\\Sun_Full_Backup'
> transaction log truncate
> ELSE
> Return
> END CASE;
> END
>
> Thank you,
> Doug
>
>


Doug Stone Posted on 2003-04-07 19:22:20.0Z
From: "Doug Stone" <nospamdstone@res-q.com>
References: <#TBjzxj#CHA.317@forums-1-dub> <uh97X8r#CHA.68@forums-1-dub>
Subject: Re: ASA Backup Event Create Directory
Date: Mon, 7 Apr 2003 12:22:20 -0700
Lines: 106
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Message-ID: <uybF2sT$CHA.287@forums-1-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: adsl-64-164-175-173.dsl.lsan03.pacbell.net 64.164.175.173
Path: forums-1-dub!forums-master.sybase.com!forums-1-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:871
Article PK: 2778

Yes, saying that the backup event will create a leaf, possibly a branch--but
never a root, trunk, branch and leaf--is an interesting way of remembering
the limits. <g>

Thanks,
Doug

"Nick Elson" <no_spam_nicelson@sybase.com> wrote in message
news:uh97X8r#CHA.68@forums-1-dub...
> From my experience (and just now testing it in 8.0.2)
> ASA and utilities will tend to create a leaf directory
> for you but will not do so for full paths (when internal
> tree directories are also missing).
>
> In the case of this statement
>
> backup database directory 'c:\\temp\\backups\\Friday'
>
> that works if there is a subtree for
>
> c:\temp\backups
>
> in existance alreaedy but not if the directory backups is
> missing too.
>
> If it helps you could for the tree heirarchy to always exists
> by coding this into a start database event script using the
> xp_cmdshell as in:
>
> create event StartupNSetup_Event
> type DatabaseStart Enable
> Handler
> begin
> . . . .
> xp_cmdshell ('md c:\\rfw' , 'no_output' );
> xp_cmdshell ('md c:\\rfw\\backups', 'no_output' );
> xp_cmdshell ('md c:\\rfw\\backups\Mon', 'no_output' );
> . . . .
> xp_cmdshell ('md c:\\rfw\\backups\Sat', 'no_output' );
> xp_cmdshell ('md c:\\rfw\\backups\Sun_Full_Backup',
'no_output' )';
> . . . .
> end
>
> That way you'll have full control over this, an autosetup feature,
> and minimum overhead.
>
> "Doug Stone" <nospamdstone@res-q.com> wrote in message
> news:#TBjzxj#CHA.317@forums-1-dub...
> > Hi. Does anyone know if the directory specified in a backup event will
be
> > created if it does not already exist?
> > I think that sometimes the event has created directories; other times
> > nothing happens--no directory, no error message.
> >
> > Here's the event:
> >
> > CREATE EVENT rfwDailyBackup
> > SCHEDULE daily_backup
> > start time '11:00 PM' every 24 hours
> > HANDLER
> > BEGIN
> > DECLARE day_of_week VARCHAR(9);
> > SELECT dayname (today()) INTO day_of_week;
> > CASE day_of_week
> > WHEN 'Monday' then
> > backup database directory 'c:\\rfw\\backups\\Mon'
> > transaction log only
> > transaction log truncate
> > WHEN 'Tuesday' then
> > backup database directory 'c:\\rfw\\backups\\Tue'
> > transaction log only
> > transaction log truncate
> > WHEN 'Wednesday' then
> > backup database directory 'c:\\rfw\\backups\\Wed'
> > transaction log only
> > transaction log truncate
> > WHEN 'Thursday' then
> > backup database directory 'c:\\rfw\\backups\\Thu'
> > transaction log only
> > transaction log truncate
> > WHEN 'Friday' then
> > backup database directory 'c:\\rfw\\backups\\Fri'
> > transaction log only
> > transaction log truncate
> > WHEN 'Saturday' then
> > backup database directory 'c:\\rfw\\backups\\Sat'
> > transaction log only
> > transaction log truncate
> > WHEN 'Sunday' then
> > backup database directory 'c:\\rfw\\backups\\Sun_Full_Backup'
> > transaction log truncate
> > ELSE
> > Return
> > END CASE;
> > END
> >
> > Thank you,
> > Doug
> >
> >
>
>