I have a SQL 2005 Maintenance plan that runs a backup to create a .bak file, and, on successful completion is supposed to run a Maintenance Clean Up task to delete any .bak files in the folder the back up task saves to that are older than 5 days.
My backups are being created, but my old files aren't being deleted. I don't see any errors in the log. I think that perhaps I have a permissions issue -- that the account the job is run under needs access to the folder the .bak files are to be deleted from. Does this seem like a likely cause of .bak files not being deleted?
How do I find out what account the job is run under? I'm guessing it would be the SQL Agent account. I thought that would be the account named 'SQLServer2005AgentUser' so I tried giving that account full control, but my .bak files are still not being deleted.
Should I take a different approach to cleaning up the old files? Or is there something else I'm doing wrong or not understanding?