Skip to content

Instantly share code, notes, and snippets.

@WaterSibilantFalling
Last active September 23, 2017 11:51
Show Gist options
  • Save WaterSibilantFalling/82dbbc1e713028517d733a788b6f5a8e to your computer and use it in GitHub Desktop.
Save WaterSibilantFalling/82dbbc1e713028517d733a788b6f5a8e to your computer and use it in GitHub Desktop.
a short script to clean out old, local, backups
#!/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