SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Cleanup txt files from Z:\drive issue?


Cleanup txt files from Z:\drive issue?

Author
Message
anzz
anzz
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1245 Visits: 704
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
Scott D. Jacobson
Scott D. Jacobson
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1322 Visits: 1020
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:\


anzz
anzz
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1245 Visits: 704
Yes looks the same
Scott D. Jacobson
Scott D. Jacobson
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1322 Visits: 1020
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?
anzz
anzz
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1245 Visits: 704
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!
Michael Valentine Jones
Michael Valentine Jones
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14399 Visits: 11848
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.
anzz
anzz
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1245 Visits: 704
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\
Scott D. Jacobson
Scott D. Jacobson
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1322 Visits: 1020
The TechNet site is a good place to start. I believe there are several "delete files older than X" type scripts there:

http://gallery.technet.microsoft.com/scriptcenter/site/search?f%5B0%5D.Type=ProgrammingLanguage&f%5B0%5D.Value=PowerShell&f%5B0%5D.Text=PowerShell

anzz
anzz
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1245 Visits: 704
Thanks !
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search