LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to change the queue name of all the scheduled jobs in Linux? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-change-the-queue-name-of-all-the-scheduled-jobs-in-linux-939073/)

achakradhare 04-10-2012 08:00 AM

How to change the queue name of all the scheduled jobs in Linux?
 
I have an application where jobs are fired sequentially with a set priority. Now it is fired and I am in midway. Still there are lot of jobs which are pending and are queued up. Now I want to change the queue name of all the scheduled jobs to the queue which is not loaded much (I know which one to load). Doing bmod -q <queue_name> <job_id> is not possible as there are hundreds of jobs in line.
Can anyone suggest me a quick way to do this? I tried with something like this:

bjobs | cut -d' ' -f1 | sed '1d' | xargs bmod -q high

But this is not working. Any suggestions?

MensaWater 04-11-2012 08:22 AM

When you say "not working" exactly what is happening?

It may be you need to do a for loop rather than piping into xargs:

Code:

for job in $(bjobs | cut -d' ' -f1 | sed '1d')
do bmod -q high $job
done

I'm not familiar with bmod so am not sure if your command syntax is correct. What happens if you pick a single job and run the bmod -q high on it?


All times are GMT -5. The time now is 08:00 AM.