diff --git a/bin/archiver.py b/bin/archiver.py index 242bdcca..c1e9810b 100755 --- a/bin/archiver.py +++ b/bin/archiver.py @@ -54,7 +54,7 @@ class Archiver(AbstractManager): archived_uuids = {} for year, month_captures in to_archive.items(): for month, captures in month_captures.items(): - dest_dir = archived_captures_dir / str(year) / str(month) + dest_dir = archived_captures_dir / str(year) / f'{month:02}' dest_dir.mkdir(parents=True, exist_ok=True) if (dest_dir / 'index').exists(): with (dest_dir / 'index').open('r') as _f: @@ -74,6 +74,7 @@ class Archiver(AbstractManager): lookyloo.redis.hdel('lookup_dirs', *archived_uuids.keys()) lookyloo.redis.hset('lookup_dirs_archived', mapping=archived_uuids) lookyloo.clear_captures_index_cache(archived_uuids.keys()) + self.logger.info('Archiving done.') def main(): diff --git a/lookyloo/lookyloo.py b/lookyloo/lookyloo.py index 892c4702..6ba013eb 100644 --- a/lookyloo/lookyloo.py +++ b/lookyloo/lookyloo.py @@ -624,6 +624,7 @@ class Lookyloo(): capture_dir = self._captures_index[capture_uuid].capture_dir if capture_dir.exists(): return capture_dir + self.redis.delete(capture_dir) self._captures_index.pop(capture_uuid) capture_dir = self.redis.hget('lookup_dirs', capture_uuid) if capture_dir and not Path(capture_dir).exists():