summaryrefslogtreecommitdiff
path: root/cron/clean_database.pl
diff options
context:
space:
mode:
Diffstat (limited to 'cron/clean_database.pl')
-rwxr-xr-xcron/clean_database.pl11
1 files changed, 11 insertions, 0 deletions
diff --git a/cron/clean_database.pl b/cron/clean_database.pl
new file mode 100755
index 0000000..f553515
--- /dev/null
+++ b/cron/clean_database.pl
@@ -0,0 +1,11 @@
+#!/usr/bin/perl
+use strict;
+use Cwd 'abs_path';
+use File::Basename;
+use local::db;
+use config;
+
+for my $dl (local::db::download->retrieve_all)
+{
+ $dl->delete if not -d $config::config{files_dir}.'/'.$dl->category->name.'/'.$dl->download_id;
+}