Getting Started with Adobe After Effects - Part 6: Motion Blur
Ask questions, discuss or help others by answering
Related Posts · View All
SQL Server 146
XML 57

Top Categories · View All
SQL Server 146
XML 57

SQL CleanUp Job

Jun 17 2014 12:00AM by smanikandan23   

I tried the following three ways to clean-up the old backup files but none of them is worked. We need your help on this to complete.

·         Way 1: Created  Maintenance Cleanup Job, the job successful executed  but backup was not deleted the files.

·         Way 2: Tried using xp_delete_file command.

Script Used: EXECUTE master.sys.xp_delete_file 0,N'\\XXX\YYY',N'bak',N'2014-05-12T07:34:14' 

Error Message:

Executed as user: DOMAIN\user. The process could not be created for step 3 of job 0x307C7663CBCA6D4187B1953745E1E02F (reason: The system cannot find the file specified).  The step failed.

Way 3: Tried using the power shell script

Script Used:

$Path = "\\xxx\yyy"

$Daysback = "-30"

$CurrentDate = Get-Date

$DatetoDelete = $CurrentDate.AddDays($Daysback)

Get-ChildItem $Path -Recurse -include *.bak| Where-Object { $_.LastWriteTime -lt $DatetoDelete } |  remove-item -force

Error Message:

Executed as user: DOMAIN\user.. The job script encountered the following errors.

These errors did not stop the script:  A job step received an error at line 9 in a PowerShell script.

The corresponding line is 'Get-ChildItem $Path -Recurse -include *.txt, *.bak| Where-Object { $_.LastWriteTime -lt $DatetoDelete } |  remove-item -force'. Correct the script and reschedule the job. The error information returned by PowerShell is: 'Cannot find path '\\xxx\yyy' because it does not exist.  '.  Process Exit Code 0.  The step succeeded.

The Powershell script was executed successfully in powershell window but not in the powershall task. also i have created proxy account which user has permission over the shared path and used the poroxy account to run the tasks.

Please help me to solve the issue.

Submitted under: Microsoft SQL Server · DBA ·  ·  · 

1808 · 0% · 11

Your Reply

Sign Up or Login to post a comment.

    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]