Thanks Bob.

I'll get to work.

Ray W. 

-----Original Message-----
From: Bob Gobeille [mailto:bob.gobei...@hp.com] 
Sent: Wednesday, June 15, 2011 3:02 PM
To: Westphal, Raymond W
Cc: 'fossology@fossology.org'
Subject: Re: [FOSSology] Clean Out Repository

Hi Ray,

It looks like you found an error in fossjobs, so I filed a bug on your behalf:
http://bugs.linux-foundation.org/show_bug.cgi?id=819

You can run delagent without the scheduler from the command line:
0) Find all your upload_pk's to delete (from previous emails)
1) Find out where your agents are installed.
In the user interface login as an administrator and click on Help > Debug > 
Global Variables
The variable AGENTDIR shows you the agent install location.   For illustration, 
let's say AGENTDIR is /usr/lib/fossology/agents.

2) Run delagent from the command line.  For example:

/usr/lib/fossology/agents/delagent -U 1234

Where 1234 is your upload_pk.  You can put that in a script to delete  all the 
uploads.   Don't run delagent in parallel or with other agents running in the 
scheduler.  Because of the file sharing that fossology does, you could run into 
concurrency problems if you do that.  If you want to see all the delagent 
options, then run delagent --help

Bob Gobeille


On Jun 15, 2011, at 8:28 AM, Westphal, Raymond W wrote:

> Thanks for the response Bob.
> 
> I'm sorry Bob; I don't understand how "to use the delete agent". When I list 
> the available default agents as fossy or root ...
> 
> fossrepo]$ fossjobs -a
> The available agents are:
> agent_bucket
> agent_copyright
> agent_mimetype
> agent_nomos
> agent_pkgagent
> agent_unpack
> agent_specagent
> agent_license
> PHP Notice:  Undefined index:  U in /usr/bin/fossjobs on line 167
> 
> Is this list complete? 
> 
> Thanks,
> 
> Ray W.
> 
> 
> 
> -----Original Message-----
> From: Bob Gobeille [mailto:bob.gobei...@hp.com] 
> Sent: Tuesday, June 14, 2011 12:27 PM
> To: Westphal, Raymond W
> Cc: fossology@fossology.org
> Subject: Re: [FOSSology] Clean Out Repository
> 
> Hi Ray,
> To find the uploads over a year old:
> 
> select upload_pk  from upload where upload_ts< (now() - interval '1 year') 
> order by upload_ts
> 
> You can then take that list and schedule the delete agent on each one of the 
> upload_pk's with the fossjobs command (man fossjobs).
> 
> Unfortunately, you can't simply delete the upload from the database because 
> that won't delete the files from the repository, and because "cascade" isn't 
> turned on for most of the foreign keys.  So, at least for now, you have to 
> use the delete agent.
> 
> Bob Gobeille
> 
> 
> On Jun 14, 2011, at 6:29 AM, Westphal, Raymond W wrote:
> 
>> 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
> 
> _______________________________________________
> fossology mailing list
> fossology@fossology.org
> http://fossology.org/mailman/listinfo/fossology

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

Reply via email to