Link to home
Start Free TrialLog in
Avatar of wilsonkjit
wilsonkjit

asked on

Require variables for scirpt to delete SQL back-up files older than 30 days

Hi all,

I require a date range or date modified variable for a script that will be designed to delete all files from a folder older than 30 days.

Currently this folder of ours is growing at around 3GB+ a day, so rather than monitoring it every month I would like to schedule a script to do it for us.

I was thinking of using the del command but as it stands I cannot get the syntax correct.

Any help would be appreciated.

Cheers
Avatar of Brian Pierce
Brian Pierce
Flag of United Kingdom of Great Britain and Northern Ireland image

Is it the transaction logs that are growing - if so I suggest you read http://support.microsoft.com/kb/873235 before you delete anything !!
Avatar of wilsonkjit
wilsonkjit

ASKER

Thanks for the prompt reply.

The folder in question is not important. It is a folder called "DatabaseBackups" that has been created for quick restore purposes. We currently back the contents of this folder up daily onto tape through Backup Exec, so it is not destructive in removing these files.

In total each day, 4 files are created to the total of 3GB+. .bak & .trm are the largest.

Rest assured it is safe to delete these files  =]
SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial