How can we help you today? How can we help you today?

Problem with erasing old backup files

Hello everybody,
I'm using SQL Backup vers 5.3.0.178. From inside a stored procedure I call sqlbackup to make backup, copy to network share, remove local files older than 1 day and remove rmote files older than 1 day. While the remote files are deleted succefully the local files don't. I tried playing around with the FILEOPTIONS parameter but so far without success.
Here's my statement:
EXEC master..sqlbackup -SQL "BACKUP DATABASES [model]
TO DISK = 'E:\\MSSQL\BACKUP\\model\<AUTO>'
WITH NAME = '<AUTO>',
DESCRIPTION = '<AUTO>',
COMPRESSION = 2,
COPYTO = '\\Server1\Backups$\model',
ERASEFILES_REMOTE = 1,
ERASEFILES = 1,
FILEOPTIONS = 3,
THREADS = 1"
Any idea how I can get this to work ?
Thanks in advance
Markus
Markus Bohse
0

Comments

2 comments

  • petey
    Do the files that were not deleted have the archive attribute set? If so, they will not be deleted as you used FILEOPTIONS = 3. If you want the files to be deleted regardless of the archive attribute value, use FILEOPTIONS = 1.
    petey
    0
  • Markus Bohse
    Yes, the files have the archive attribute set. I will give it a try using Fileoption1.

    Thanks Markus
    Markus Bohse
    0

Add comment

Please sign in to leave a comment.