Hello Everyone.

I'm trying to find a way to automatically cleanup the repository. The users 
will allow me to delete uploads older than 1 year.

I created the following query from watching the database while I selected the 
Organize/Uploads/Delete Uploaded File menu option.

SELECT upload_pk, upload_desc, upload_ts, ufile_name
 FROM foldercontents,uploadtree,upload
 WHERE foldercontents.parent_fk = '4'
 AND upload_ts < (select current_date -365)
 AND foldercontents.foldercontents_mode = 2
 AND foldercontents.child_id = upload.upload_pk
 AND uploadtree.upload_fk = upload.upload_pk
 AND uploadtree.parent IS NULL;
 ORDER BY upload_ts;

Can I simply delete from the upload table where upload_ts  < (select 
current_date -365) ?

Thanks,
Ray W.

CONFIDENTIALITY NOTICE: This e-mail and any files transmitted with it are 
intended solely for the use of the individual or entity to whom they are 
addressed and may contain confidential and privileged information protected by 
law. If you received this e-mail in error, any review, use, dissemination, 
distribution, or copying of the e-mail is strictly prohibited. Please notify 
the sender immediately by return e-mail and delete all copies from your system.


_______________________________________________
fossology mailing list
fossology@fossology.org
http://fossology.org/mailman/listinfo/fossology

Reply via email to