Another FILEOPTIONS question
I backup to local disk and copy to a network share using COPY_TO, ERASEFILES=23h, ERASEFILES_REMOTE=30 and FILEOPTIONS=1. Works great. I have one server that doesn't have enough disk available to hold the one day's worth of backup files. So I backup to another server and then copy to the network share using the same command options. So technically, both locations are remote, but I thought ERASEFILES=23h would delete the files from the backup location. What happens is both locations keep files for 30days, the ERASEFILES_REMOTE option. Is there anyway I can handle this within SQL Backup? Here's my command...
EXECUTE master..sqlbackup N'-SQL "BACKUP DATABASES [sde, ReportServer] TO DISK = ''\\sqlalpha01\e$\sql_backup_helpdesk\<AUTO>.sqb'' WITH COPYTO = ''\\filcnc1s08pp001\sqlback01\HelpDesk\'', COMPRESSION = 1, ERASEFILES = 23h, ERASEFILES_REMOTE = 30, FILEOPTIONS = 1, MAILTO_ONERROR = ''[email protected]''"', @exitcode OUT, @sqlerrorcode OUT