Last active
September 23, 2017 11:51
-
-
Save WaterSibilantFalling/82dbbc1e713028517d733a788b6f5a8e to your computer and use it in GitHub Desktop.
a short script to clean out old, local, backups
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
# this script: | |
# | |
# cleans out various directories | |
# one block for each thing to clean out | |
# | |
# | |
# --- vim temp backups | |
# 4 days of BU's should be enough for 'whoops, shouldn't have deleted' | |
my $DAYS_OF_VIM_BACKUPS=4; | |
my $VIM_BU_DIR="/work/BACKUP/vimBackups/"; | |
# equal to - greater than $DAYS_OF_VIM_BACKUPS days rm'd | |
`find $VIM_BU_DIR -type f -ctime $DAYS_OF_VIM_BACKUPS -exec rm {} \\; `; | |
# greater than - greater than greater than $DAYS_OF_VIM_BACKUPS days rm'd | |
`find $VIM_BU_DIR -type f -ctime +$DAYS_OF_VIM_BACKUPS -exec rm {} \\; `; | |
# --- remote backup listing files | |
require("buFunctions.pl"); | |
removeOldBuFiles( ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment