Skip to main content
Gavin Farrington
Participating Frequently
July 1, 2012
Open for Voting

P: Set Maximum # Of Catalog Backups, and Auto-Replace Oldest

  • July 1, 2012
  • 24 replies
  • 2334 views

Currently it's up to the user to check how many catalog backups have been created, and delete the oldest ones. For people with large catalogs, the amount of disk space consumed can be significant.

It would be great if I could tell LR to create a maximum of 3 backups, and automatically replace the oldest one with the newest one.

24 replies

Lauca
Participating Frequently
October 22, 2018
Since LR doesn't has this cleanup function, I've written a Powershell script that remove the backup based on the age and the minimum number to keep. In case it may be useful to some of you, here it is :

>>>>>>
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%# Script Suppress LR Backup
# Purpose
# =======
# This script will remove all but the n most recent LR catalog backup
# files, providing they are old enough.
# The number of files to keep is defined in $FilesToKeep
# The oldest aging to keep is defined in $lastmod
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

# Declaring variables

#$mypath = "S:\Temp\testremove\test"
$mypath = "S:\Sauvegarde\Catalogue_LR"
$FilesToKeep = 5 # Minimume number of files to keep
$jour = Get-Date
$lastmod = $jour.AddDays(-10) # Minimum aging days for the file to be removed


# Suppress all but the "$FilesToKeep" most recent files,
# providing the files are old enough.
$Count = 0
Get-Childitem $mypath -file -recurse | Sort-object $_.LastWriteTime -Descending | Foreach {
$Count = $Count +1
IF ($Count -gt $FilesToKeep) {
IF ($_.LastWriteTime -le "$lastmod") {
# write-host "Deleting File" + $_.fullname -foregroundcolor "Red";
Remove-Item $_.fullname | out-null
}
}
}
# Suppress the empty folders
$ListFolder = Get-Childitem $mypath -Directory -recurse | where { @(gci $_.Fullname).count -eq 0}
Foreach ($Folder in $ListFolder) {
Remove-Item $Folder.Fullname -Recurse | out-null
}

# End of script

<<<<<<<<<<<<


Art M.
Known Participant
October 22, 2018
YES it would be great to be able to specify max 3 backups or something more sophisticated.  In the meantime, at least TELL people that it's ok to delete backups!   First, they may not be aware of them, and second, like me, they may initially fear deleting backups thinking that they are incremental rather than individually complete. 
Inspiring
October 22, 2018


There really needs to be a user settable parameter to remove old copies of LR Catalog backups.  It could either be based on age of the backup or on the number of backups that are currently in the specified backup location.  I work with clients and often find hundreds, if not thousands of old LR catalog backups consuming a lot of space on their hard drives for no reason at all except then don't know they are there and don't know they can delete them with no harm.  This is a significant oversight in the catalog management process that needs to be corrected.
Inspiring
April 14, 2016
Looks I'm late to the party but only now realized how I had about 60GB of wasted space with my lrcat backups.  Please Adobe, help us better manage our disks.
Inspiring
April 18, 2014
I too, would like to see a "save most recent X backups" feature. It is annoying how the backups fill up the hdd (and one forgots about deleting them manually)
thanks
Known Participant
April 4, 2014


I love LR5 but wish there was a way to limit the number of backups saved in an automatic way. I backup at least once a day when exiting and when I forget to check the backup folder for a long time Giga bytes have been eaten up on my hard drive. This is easy to resolve if your memory (personal) is good enough, but couldn't LR handle this by a Preference that allowed me to select "Save the most recent X (e.g., 6) backups and then I could remember more important things that LR can't remember. Thanks!
Inspiring
January 13, 2013
It would be really great to have the option to only save a certain number of backups. At the moment I have to delete excess backups as I save them to cloud storage and they take up quite a lot of space. I'd like the option to only save the last 3 backups, the fourth being automatically deleted when a new backup is made.

areohbee
Legend
January 7, 2013
I recommend a scheme that allows user to keep x per year (old years), and y per month (old months), or something like that.

In other words having the latest 15 catalogs does no good if you oppsidentally reset a bunch of photos 16 catalogs ago. One is not likely to restore everything from 16 catalogs back, but one does not need to restore an entire catalog, one can just import adjustments for selected photos from an old backup...
Participating Frequently
January 7, 2013
Implement possibility to specify automatic deleting of old backups.
Old backups of LR catalogs are building up quite fast which is a waste of storage space unless old backups are deleted manually. Would be nice to automate the removing of old backups.

Inspiring
November 24, 2012
Clear backups LR catalog safely from LR. I had twice problems with deleting old backup files by hand. In the first time, I only lost one day work at all; in the second one, this time, I lost more than month and half work... I was deleting them because they weighted all together more than 40 GBs (1 GB per lrcat).

So, I was sure that I was deleting them correctly, all the backup files except of this month. Everything OK, 30 GB more on HD. Next, I enter LR and says that there's no catalog. What? Lost again? Look in the catalog folder for files. Nothing, everything empty... Not possible! Again!

So I lost/deleted all my backup files and only recover with a good recovery application but at the date of October 13th of this year...

It could be possible to do the cleaning from LR with safety?? This type of human errors could be avoided...

Thanks!