Hello
If you are on Windows, you can use this script I am using to delete backup files older than x days.
If you don't know what autohotkey is, you must install autohotkey to run these scripts. It's for Windows.
replace blue text with your path. It will search for all backups in that path and its subdirectories recursively.
and red number for the number of days to retain. The older backup will be moved to recycle bin.
save it as "PurgeBackups.ahk" for example and run it.
I wonder if it is possible to modify this script to delete all older than x days, but retaining last one of each day.
But it is also useful as it is. We all know how big the auto backups folder can grow.
If you are on Windows, you can use this script I am using to delete backup files older than x days.
If you don't know what autohotkey is, you must install autohotkey to run these scripts. It's for Windows.
replace blue text with your path. It will search for all backups in that path and its subdirectories recursively.
and red number for the number of days to retain. The older backup will be moved to recycle bin.
save it as "PurgeBackups.ahk" for example and run it.
I wonder if it is possible to modify this script to delete all older than x days, but retaining last one of each day.
But it is also useful as it is. We all know how big the auto backups folder can grow.
Code:
DeleteOlderThan(path, olderThan, recursive := 0)
{
loop, % path, 0, % recursive
{
today := A_Now
EnvSub, today, % A_LoopFileTimeModified, days
if (today > olderThan)
{
FileRecycle, % A_LoopFileLongPath
}
}
}
DeleteOlderThan("C:\My Projects\*.rpp-bak", 14, 1)
Script to delete backup files older than x days (autohotkey for windows)
Aucun commentaire:
Enregistrer un commentaire