use strict;
use SL::BackgroundJob::Base;
+use SL::BackgroundJob::BackgroundJobCleanup;
use SL::BackgroundJob::CleanBackgroundJobHistory;
use SL::BackgroundJob::CreatePeriodicInvoices;
--- /dev/null
+package SL::BackgroundJob::BackgroundJobCleanup;
+
+use strict;
+
+use parent qw(SL::BackgroundJob::Base);
+
+use SL::DB::BackgroundJob;
+
+sub create_job {
+ $_[0]->create_standard_job('0 3 * * *'); # daily at 3:00 am
+}
+
+sub run {
+ SL::DB::Manager::BackgroundJob->cleanup;
+
+ return 1;
+}
+
+1;
+
+__END__
+
+=encoding utf8
+
+=head1 NAME
+
+SL::BackgroundJob::BackgroundJobCleanup - Background job for
+cleaning the background job table of all executed one time jobs
+
+=head1 SYNOPSIS
+
+This background job deletes old entries from the table
+C<background_jobs>. This happens to background jobs that were
+supposed to run only once and were already run.
+
+The job is supposed to run once a day.
+
+=head1 BUGS
+
+Nothing here yet.
+
+=head1 AUTHOR
+
+Sven Schöling E<lt>s.schoeling@linet-services.deE<gt>
+
+=cut
--- /dev/null
+#!/usr/bin/perl
+# @tag: background_jobs_3
+# @description: Backgroundjob Cleanup einrichten
+# @depends: emmvee_background_jobs_2
+# @charset: utf-8
+
+use strict;
+
+use SL::BackgroundJob::BackgroundJobCleanup;
+
+SL::BackgroundJob::BackgroundJobCleanup->create_job;
+
+1;