SQLTeam.com | Weblogs | Forums

Do I need to specify RETAINDAYS for a COPY_ONLY backup with an INIT?


#1

Our backup script doesn't have an INIT specified and the job that moves our backup failed over the weekend. Then when the next backup happened, it appended to the set and our server ran out of space.

So I'm going to specify an INIT in the WITH section, but I can't find anything that says if the INIT with a COPY_ONLY uses the retention settings for the server, or since it's a COPY_ONLY, it just overwrites any existing script.

Do I need to specify a RETAINDAYS=1 in the or can I just add the INIT?

I also see that RETAINDAYS is going away, is EXPIREYDATE the new option?


#2

Best as I know it nothing does anything with Retention Period - except for a job that deletes backup files based on their expiry date (implicit or calculated).

We uniquely name all our backup files (Database name + Date + Time + Backup type) and have a separate process which has the responsibility of deleting old / stale files. No chance of anything being overwritten, and no risk of "assuming" that a backup file is of a particular vintage! (that meta data is stored in the backup file, of course, but the world can change between Checking and Doing if something can delete/recreate the same named-object in that time interval.