October 9, 2012 at 1:16 pm
I have job setup on all the PROD servers(2005, 2008r2, 2012).
The Job will generate a .txt file every day for each database to scripts out permission.
And saving a permission scripts for 5day and do clean up.
Here is the issue,
I am doing maintenance cleanup task(maintenance plan) to do a cleanup,
But it is not working, It does not clean up the .txt file on any of the servers (2005, 2008r2, 2012).
what was the issue? Do I am doing wrong way to do cleanup?
any alternate solution do do clean up?
example my file name conversation are: DBname_DBuserlist_20121009
October 9, 2012 at 1:46 pm
Does your Maintenance Plan Cleanup task look like this? Note the lack of a dot (.) in the File extension box. Also, if you're creating directories for each DB, you'll need to check the box next to "Include first-level subfolders". Also make sure the folder path is correct if you're not placing the files on the root of Z:
October 9, 2012 at 2:44 pm
Yes looks the same
October 10, 2012 at 6:55 am
Do the accounts for SQL Server and SQL Server Agent have permissions to the path you're attempting to delete files in? How are you executing the Maintenance Plan, through a SQL Server Agent job?
October 10, 2012 at 8:13 am
Using SA account.
All my .bak backup cleanup history works fine, cleanups after 48Hrs.
I doesn't work for my txt file to cleanup. These txt file are created by job in process, these are not report txt files.
Is there is way, I can create a job step to clean up txt files
any help please!
October 10, 2012 at 8:39 am
Danzz (10/10/2012)
Using SA account.All my .bak backup cleanup history works fine, cleanups after 48Hrs.
I doesn't work for my txt file to cleanup. These txt file are created by job in process, these are not report txt files.
Is there is way, I can create a job step to clean up txt files
any help please!
The maintenance plan file cleanup tasks only cleanup backup files created by maintenance plans or report text files created by maintenance plans.
You could use ActiveX , Command shell, or Powershell to cleanup the txt files.
October 10, 2012 at 12:34 pm
Thanks Michael!
Can I get a command of (ActiveX , Command shell, or Powershell)
example my file name are: DBname_DBuserlist_20121009.txt
Location Z:\Permissions\
October 10, 2012 at 2:30 pm
The TechNet site is a good place to start. I believe there are several "delete files older than X" type scripts there:
October 10, 2012 at 3:34 pm
Thanks !
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply