Author Topic: Clearing /var/spool/qube/job without corrupting MySQL database  (Read 11867 times)

westernx

  • Hero Member
  • *****
  • Posts: 55
Clearing /var/spool/qube/job without corrupting MySQL database
« on: January 25, 2010, 07:25:39 PM »
Hello . . .

I have jobs that are starting to just sit there for days . . . It was suggested to me to clear the job archive. My supervisor job log is huge and I want to clear it without screwing things up in mysql.  How can I go about doing this correctly?

vfx-xserve:qube root# pwd
/var/spool/qube

vfx-xserve:qube root# du -sh job
 34G   job

Help!

« Last Edit: January 25, 2010, 08:43:53 PM by ryjguy7 »

jburk

  • Administrator
  • *****
  • Posts: 493
Re: Clearing /var/log/job without corrupting MySQL database
« Reply #1 on: January 25, 2010, 08:46:25 PM »
Are you removing old/done jobs from Qube, and you want to clear out the logs from these jobs that are no longer in Qube?

If you look into /var/spool/qube/job, you'll see directories that correspond to the 1000's of the qube job id's (jobs 0-999 are in 0, 1000-1999 are in 1000/, etc).

Here's the simplest way:
Find the lowest number jobid that is still in your system, round down to the thousand, and then you can remove all the directories that are less than that thousand value.

Say your lowest jobID is 12345.  You can remove all directories up to and including job/11000.

westernx

  • Hero Member
  • *****
  • Posts: 55
Re: Clearing /var/spool/qube/job without corrupting MySQL database
« Reply #2 on: January 25, 2010, 09:44:22 PM »
Thanks.  So I was afraid to remove the log job id's I didn't need, because I wasn't sure if it would affect the mysql database in a weird way.  But I manually removed the job dirs I no longer needed, and restarted the supervisor.  Is there anything else I should have done,  any recommendations? . . .

ryjguy7

westernx

  • Hero Member
  • *****
  • Posts: 55
Re: Clearing /var/spool/qube/job without corrupting MySQL database
« Reply #3 on: January 25, 2010, 10:19:04 PM »
. . . in my /var/spool/qube/job folder

vfx-xserve:job root# ls
10000   11000   6000   7000   8000   9000

I removed all directories in the 6000,7000,8000,9000 job folders.

. . . then I restarted qube.  Do I need to refresh the workers or adjust the mysql database somehow?

ryjguy7

jburk

  • Administrator
  • *****
  • Posts: 493
Re: Clearing /var/spool/qube/job without corrupting MySQL database
« Reply #4 on: January 26, 2010, 06:08:27 PM »
Nope, no need to do anything other than delete the directories that belong to removed jobs.

Since they've been removed from Qube, the database doesn't know anything about them anymore, and if they're not in the db, the supervisor doesn't know about them anymore, and the worker never cared once it had finished the job.

If you like, and since you're on Linux, I can set you up with a script that you can run as a cron job once or twice a day that will automatically clean out logs that are from removed jobs.

westernx

  • Hero Member
  • *****
  • Posts: 55
Re: Clearing /var/spool/qube/job without corrupting MySQL database
« Reply #5 on: January 29, 2010, 08:04:08 PM »
. . . ya sure that would be helpful, thanks