Merge remote-tracking branch 'calcms/master'
This commit is contained in:
@@ -92,6 +92,7 @@ apt-get install <deb-package>
|
||||
libhtml-parser-perl
|
||||
libhtml-template-perl
|
||||
libhtml-template-compiled-perl
|
||||
libmime-tools-perl
|
||||
libsession-token-perl
|
||||
libtext-multimarkdown-perl
|
||||
libtext-wikicreole-perl
|
||||
|
||||
47
tools/cleanup-archive.pl
Normal file
47
tools/cleanup-archive.pl
Normal file
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/perl
|
||||
use warnings;
|
||||
use strict;
|
||||
use Data::Dumper;
|
||||
|
||||
my $base_dir=shift;
|
||||
-d $base_dir or die "Usage: $0 <path-to-cleanup>\n";
|
||||
|
||||
my $now = time;
|
||||
my $day = 24 *60 * 60;
|
||||
|
||||
sub remove{
|
||||
my ($file) = @_;
|
||||
print "remove $file\n";
|
||||
unlink $file;
|
||||
}
|
||||
|
||||
sub cleanup_files{
|
||||
my ($dir) = @_;
|
||||
opendir my $dh, $base_dir or die "Could not open '$base_dir' for reading: $!\n";
|
||||
while (my $file = readdir $dh) {
|
||||
next if $file eq '.' or $file eq '..';
|
||||
my $path="$base_dir/$file";
|
||||
if (-l $path){
|
||||
my $age = ($now-(lstat $path)[9])/$day;
|
||||
remove $path if $age > 7;
|
||||
}elsif (-f $path){
|
||||
my $age = ($now-(stat $path)[9])/$day;
|
||||
remove $path if $age > 360;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub cleanup_tmp_files{
|
||||
my ($dir) = @_;
|
||||
opendir my $dh, $dir or die "Could not open '$dir' for reading: $!\n";
|
||||
while (my $file = readdir $dh) {
|
||||
next if $file eq '.' or $file eq '..';
|
||||
my $path="$base_dir/$file";
|
||||
my $age = ($now-(stat $path)[9])/$day;
|
||||
remove $path if $age > 7;
|
||||
}
|
||||
}
|
||||
|
||||
cleanup_files($base_dir);
|
||||
cleanup_tmp_files("$base_dir/tmp");
|
||||
|
||||
@@ -25,11 +25,12 @@ my $entries = db::get($dbh, $query);
|
||||
my %paths = map {normalize($_->{path}) => $_->{start}} @$entries;
|
||||
|
||||
my $dir = $config->{locations}->{local_audio_recordings_dir};
|
||||
for my $file (sort glob("$dir/*m4a")) {
|
||||
for my $file (sort glob("$dir/*")) {
|
||||
next if $file !~ /\.(mp3|wav|flac|aac|ogg|m4a|aiff|aif|opus|aac)$/i;
|
||||
next if -M $file < 14;
|
||||
my $filename = normalize($file);
|
||||
unless (exists $paths{$filename}) {
|
||||
print " --- $filename\n";
|
||||
print "$filename\n";
|
||||
unlink $file or die $! if $delete;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -710,7 +710,7 @@ ul.tabContainer li:last-child{
|
||||
}
|
||||
|
||||
#content #dialog{
|
||||
position:absolute;
|
||||
position:fixed;
|
||||
z-index:1000;
|
||||
left: 0;
|
||||
right: 0;
|
||||
|
||||
Reference in New Issue
Block a user