Deleting old Log Files

SamCSamC Posts: 28
edited June 16, 2005 11:49PM in SQL Backup Previous Versions
There are hundreds of individual SQL Backup log files accumulating somewhere under

\My Documents\...\SQL BackupIs there any automated method to retain the last week or so?

Comments

  • peteypetey Posts: 2,358 New member
    Not yet.
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Hi Sam,

    If you are using a script to do the backups, you could add a bit at the end to call xp_cmdshell to run a batch file to delete these files from your hard disk.
  • The SQL Server Database Maintenance Plan is creating schedules to delete the older files (older than a certain amount of days).
    How can I keep the last backup (scheduled to be every day) and the logs (which I want to be backed up every 2 hours) from the moment I backup the full database to the moment the schedule will create another full backup file.
    How can I get rid of those old files?
  • peteypetey Posts: 2,358 New member
    Delete full backup files every 1 day, and delete all trx log files everytime a full backup is made?
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
  • I didn't even realize how many log files had "piled" up on my box. There really needs to be a way to delete old logs. I had over 13000 of them!!
  • peteypetey Posts: 2,358 New member
    Option to delete log files older than x number of days is planned to be included in a future release.
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
Sign In or Register to comment.