1

We are using a TSQL script to back up our database every night, and in this scrip it uses -DelBkUps 1DAYS to remove the old disk copy of the backup. However we are running out of disk space at the moment and I would like to change this to something like -DelBkUps 0.5DAYS

The documentation here http://msdn.microsoft.com/en-us/library/ms162827.aspx says that i should use time_span but gives me no examples of what is acceptable in this field.

Can some one here help me find acceptable documentation, or give me an example of how I would set the time_span to a number of hours instead of days?

sec_goat
  • 169
  • 1
  • 1
  • 13

1 Answers1

3

The format for this is listed at the bottom of the syntax section of the web page referenced.

<time_period> ::=
number[minutes | hours | days | weeks | months]

Here are the samples.

number[minutes| hours| day| weeks| months]
Specifies the time interval used to determine if a report or backup file is old
enough to be deleted. number is an integer followed (without a space) by 
a unit of time. Valid examples:
12weeks
3months
15days
If only number is specified, the default date part is weeks.
  • 1
    Well don't I feel silly now? I just missed that part when I read over it. I had to go back and re-read it again to catch it. – sec_goat Mar 12 '13 at 14:32