diff --git a/ckanext/archiver/tasks.py b/ckanext/archiver/tasks.py index a8cb4ce..06b4d5f 100644 --- a/ckanext/archiver/tasks.py +++ b/ckanext/archiver/tasks.py @@ -614,6 +614,10 @@ def archive_resource(context, resource, log, result=None, url_timeout=30): else: # cache_url for uploaded resource is the same as download url cache_url = resource['url'] + + # delete the file from archive storage + if os.path.isfile(saved_file): + os.remove(saved_file) else: shutil.move(result['saved_file'], saved_file)