I've just started using the erasefiles extension in my backup script and got a nasty surprise when I looked in the backup directory this evening. I was using the following cmd from a batch file -
"C:\Program Files\Red Gate\SQL Backup\SQLBackupC" -SQL "backup database fred to DISK = '<AUTO>' with ERASEFILES=1,MAILTO_ONERROR='
xxx@xxx.co.nz'"
and a similar script to make hourly transaction log backups. (It also has erasefiles=1 - is this strictly necessary? The help doesn't distinguish between log and full backups regarding deletion).
It's 10pm here but I don't have any files prior to 2am this morning. They were there this morning.
"C:\Program Files\Red Gate\SQL Backup\SQLBackupC" -SQL "backup database fred to DISK = '<AUTO>' with ERASEFILES=1,MAILTO_ONERROR='xxx@xxx.co.nz'"
and a similar script to make hourly transaction log backups. (It also has erasefiles=1 - is this strictly necessary? The help doesn't distinguish between log and full backups regarding deletion).
It's 10pm here but I don't have any files prior to 2am this morning. They were there this morning.