REPOST: Deleting backups on a share
charleyevans
Posts: 15
I noticed that I can create backups using the UNC path to the share, as described in one of the stickies in this forum. However, I've seen that I receive a 160 Error, unable to delete backups when trying to use ERASEFILES in a script. I checked and the files that should be deleted are in fact not deleted.
Both my account and the account the SQL Backup Service runs under are configured with full permissions on the share. I can go to the share through Windows Explorer using the same path and delete the files manually without issue.
Is this a known issue with SQLBackup? I can't seem to find any information regarding this. Are there any known workarounds? I've figured I'll just use some PowerShell scripting to do the job for me. However, any help in this is greatly appreciated.
Both my account and the account the SQL Backup Service runs under are configured with full permissions on the share. I can go to the share through Windows Explorer using the same path and delete the files manually without issue.
Is this a known issue with SQLBackup? I can't seem to find any information regarding this. Are there any known workarounds? I've figured I'll just use some PowerShell scripting to do the job for me. However, any help in this is greatly appreciated.
Thanks,
Charles Evans
Charles Evans
Comments
What is your ERASEFILES setting time period configured to be? Is it possible that multiple SQL Backup jobs are contending to delete the same files?
Thanks.
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8
Normally, we just look for anything older than a day to erase. In order to test things, I've been using 1 hour instead. There are no other processes touching this share. So no there is not another backup job that it is competing with. That was my first inclination was I/O contention, followed by account permissions.
Peter,
This is the log...
SQL Backup log file
12/7/2006 12:51:09 PM: Backing up Dev (transaction log) to:
\\server\share\LOG_(local)_Dev_20061207_125109.sqb
12/7/2006 12:51:09 PM: BACKUP LOG [Dev] TO DISK = '\\server\share\LOG_(local)_Dev_20061207_125109.sqb' WITH NAME = '<AUTO>', DESCRIPTION = '<AUTO>', ERASEFILES = 1h, COMPRESSION = 1, THREADS = 1
12/7/2006 12:51:10 PM: Backup data size : 832.000 KB
12/7/2006 12:51:10 PM: Compressed data size: 10.000 KB
12/7/2006 12:51:10 PM: Compression rate : 98.80%
Processed 0 pages for database 'Dev', file 'Dev_log' on file 1.
BACKUP LOG successfully processed 0 pages in 0.014 seconds (0.000 MB/sec).
12/7/2006 12:51:12 PM: Deleting old backup file: \\server\share\LOG_(local)_Dev_20061206_123003.sqb
12/7/2006 12:51:13 PM: Warning 160: ERASEFILES error: Failed to delete file: \\server\share\\LOG_(local)_Dev_20061206_123003.sqb.
Of course, I've changed the name of the database and the file paths to something generic. Otherwise, this is exactly what we're seeing.
Thanks for any help you can provide.
Charles Evans
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8
Charles Evans
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8
Charles Evans
Charles Evans