File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,17 @@ It also comes with a dryrun option.
41
41
ckan -c /var/www/ckan/development.ini ogdch cleanup_resources
42
42
```
43
43
44
- ## Command to clean up the package extra table.
44
+ ### Command to cleanup resource-files from the filestore.
45
+ When a resource gets deleted will be marked as deleted in the database and also its associated file in the CKAN-FileStore won't be deleted.
46
+ This command finds these orphaned files by checking whether their corresponding resource still exists.
47
+ It is meant to be run regularly by a cronjob.
48
+ It also comes with a dryrun option.
49
+
50
+ ``` bash
51
+ paster --plugin=ckanext-ogdchcommands ogdch cleanup_filestore -c /var/www/ckan/development.ini
52
+ ```
53
+
54
+ ## Command to cleanup the package extra table.
45
55
When a key is no longer needed in the package_extra table, since it is no longer part of the dataset,
46
56
then after the data have been migrated that old key can be removed from the package_extra table
47
57
and from the dependent table package_extra_revision.
Original file line number Diff line number Diff line change @@ -233,10 +233,10 @@ def ogdch_cleanup_filestore(context, data_dict):
233
233
filepaths = []
234
234
errors = []
235
235
236
- for subdir , dirs , files in os .walk (storage_path ):
236
+ for subdir , dirs , files in os .walk (resource_path ):
237
237
for file in files :
238
238
fullpath = os .path .join (subdir , file )
239
- relpath = os .path .relpath (fullpath , storage_path )
239
+ relpath = os .path .relpath (fullpath , resource_path )
240
240
resource_id = get_resource_id (relpath )
241
241
242
242
tk .check_access ("resource_show" , context , {"id" : resource_id })
You can’t perform that action at this time.
0 commit comments