Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Queue enabler for Solaris 11.3 Post 303031103 by feroccimx on Thursday 21st of February 2019 02:41:30 PM
Old 02-21-2019
Queue enabler for Solaris 11.3

Hello,

I was asked to modify below script to adapt it to Solaris 11.3. I am not sure if it is ksh or bash, but need your assistance to do it for Solaris 11.3

Code:
## Variables
flag="/sysadm/bin/queue_enabler.flg"
set -A maillist  unixadm@unixhost.tv
############

##### Remove logs older than 1 week #####
cd /tmp && find . -name "queue_enabler.*" -mtime +6 -exec rm {} \;
#########################################

echo "\n`date +'%D %T'`\n" >> /tmp/queue_enabler.`date +'%m%d'`

if [[ -e $flag ]]
then
        for mail in ${maillist[@]}
                do
                        echo "Duplicate queue_enabler11 process with ID $$ running"|mail -s test_unixhost_check_queue_enabler $mail
                done
        exit 1
fi

echo $$ >> $flag

for i in `lsallq`
do
        status=`enq -s -P $i|grep $i|awk '{print $3}'`
        if [[ $status = DOWN ]]
            then
                print "Queue $i found DOWN and enabled on `date +'%D %T'`" >> /tmp/queue_enabler.`date +'%m%d'`
                qadm -U $i
        fi
done

rm $flag

Thank you in advance!
 

10 More Discussions You Might Find Interesting

1. Programming

Solaris- print to a remote queue

Is it possible to send a print job to a print queue on a different machine? (3 Replies)
Discussion started by: dangral
3 Replies

2. Programming

Queue

:confused: I have some problem with the technology Queue in Unix Can someone explain me the way queue is made and how it excute ,how it run Thanks in advance (1 Reply)
Discussion started by: iwbasts
1 Replies

3. UNIX for Advanced & Expert Users

Solaris 8 setting up a remote printer queue

I have a printer installed over ADSL to a router at a remote location. A Windows printer queue has been setup and working and I can ping the IP address from the Solaris server. I now want to add a printer queue for this printer under Solaris, but I am unsure how to setup a remote printer queue.... (0 Replies)
Discussion started by: miredale
0 Replies

4. Programming

message queue

Hello, i need to write a message queue "chat server", that should work only localy. Can anyone please help me with some ideas and peshaps code. I'm studying the UNIX IPC mechanisms right now. So far, i understand how it works but i still cannot get an idea how to write a chat programm... ... (2 Replies)
Discussion started by: etenv
2 Replies

5. Shell Programming and Scripting

mq queue depth

hi how to find the queue depth of MQ Queue using unix please its very urgent (0 Replies)
Discussion started by: Satyak
0 Replies

6. Solaris

Help required in installing Java Message queue in Solaris 10

Hi All, We are already having sun Java Message Queue installed in our solaris 10 server installed by my senior colleagues. Now I need to do fresh installation the same thing in another solaris 10 server. I took the setup named "mq3_7-ent-solsparc.zip" and copied to the new server. Now all I... (4 Replies)
Discussion started by: nsurendiran
4 Replies

7. Solaris

creating printer queue in Solaris 10

I have installed the foo2zjs drivers but i don't know the next steps to how to make a print queue with ppd files........kindly guide me out if anyone have used foo2jzs or some other methods to configure the hp laserjet 1022n printer.Kindly explain step by step procedure of how to do this. ... (2 Replies)
Discussion started by: kumarmani
2 Replies

8. UNIX for Dummies Questions & Answers

Solaris 8 setup remote printer queue help

I am trying to setup a remote printer (home users printer) through Solaris 8. The IP address is 172.16.17.10 and I can ping the printer, a local windows printer queue has been setup and works but now I am trying to setup a remote Unix printer queue. With this being a remote printer, do I need to... (2 Replies)
Discussion started by: miredale
2 Replies

9. Solaris

Solstice 6.0.3 - Server is disabled Install base enabler

hi people, I receive this message in the nwadmin: Registration info event: Server is disabled Install base enabler License enabler: #none (Networker/10 Eval) has expired. What happened? Please help me... Thank you (0 Replies)
Discussion started by: denisgomes
0 Replies

10. Shell Programming and Scripting

MQ Queue depth.

Hi All, We have SuoOs and Linux servers. May i know how do we find the queue depth of IBM MQ from server. (2 Replies)
Discussion started by: Girish19
2 Replies
DATETIME.SETDATE(3)							 1						       DATETIME.SETDATE(3)

DateTime::setDate - Sets the date

       Object oriented style

SYNOPSIS
public DateTime DateTime::setDate (int $year, int $month, int $day) DESCRIPTION
Procedural style DateTime date_date_set (DateTime $object, int $year, int $month, int $day) Resets the current date of the DateTime object to a different date. PARAMETERS
o $object -Procedural style only: A DateTime object returned by date_create(3). The function modifies this object. o $year - Year of the date. o $month - Month of the date. o $day - Day of the date. RETURN VALUES
Returns the DateTime object for method chaining or FALSE on failure. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.3.0 | | | | | | | Changed the return value on success from NULL to | | | DateTime. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 DateTime.setDate(3) example Object oriented style <?php $date = new DateTime(); $date->setDate(2001, 2, 3); echo $date->format('Y-m-d'); ?> Procedural style <?php $date = date_create(); date_date_set($date, 2001, 2, 3); echo date_format($date, 'Y-m-d'); ?> The above examples will output: 2001-02-03 Example #2 Values exceeding ranges are added to their parent values <?php $date = new DateTime(); $date->setDate(2001, 2, 28); echo $date->format('Y-m-d') . " "; $date->setDate(2001, 2, 29); echo $date->format('Y-m-d') . " "; $date->setDate(2001, 14, 3); echo $date->format('Y-m-d') . " "; ?> The above example will output: 2001-02-28 2001-03-01 2002-02-03 SEE ALSO
DateTime.setISODate(3), DateTime.setTime(3). PHP Documentation Group DATETIME.SETDATE(3)
All times are GMT -4. The time now is 06:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy