Unix/Linux Go Back    


Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle.

Automating old Boot Environment Cleanup Solaris 11

Solaris


Tags
solved

Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 11-02-2017   -   Original Discussion by os2mac
os2mac's Unix or Linux Image
os2mac os2mac is offline
Registered User
 
Join Date: Oct 2012
Last Activity: 13 December 2017, 6:19 PM EST
Location: Anchorage, AK
Posts: 248
Thanks: 22
Thanked 25 Times in 25 Posts
Wrench Automating old Boot Environment Cleanup Solaris 11

I'm trying to automate the patching process using scripts and cronjobs in Solaris 11.

one of the things I'd like to do is cleanup the old boot environments.

unfortunately


Code:
beadm destroy

requires a response


Code:
:~$ pfexec beadm destroy -f solaris-13
Are you sure you want to destroy solaris-13?  This action cannot be undone(y/[n]):

I've checked the man pages and even with a -f/F it still requires a response.

Anyone got any handy ideas on how to deal with the programmatically?

thanks

Jim
Sponsored Links
    #2  
Old Unix and Linux 11-02-2017   -   Original Discussion by os2mac
Don Cragun's Unix or Linux Image
Don Cragun Don Cragun is offline Forum Staff  
Administrator
 
Join Date: Jul 2012
Last Activity: 13 December 2017, 10:10 PM EST
Location: San Jose, CA, USA
Posts: 10,774
Thanks: 590
Thanked 3,771 Times in 3,219 Posts
If a single prompt is issued, or if there are several prompts and they all require a "y" response, you can invoke it in a pipeline reading output from the yes utility.
The Following User Says Thank You to Don Cragun For This Useful Post:
os2mac (11-02-2017)
Sponsored Links
    #3  
Old Unix and Linux 11-02-2017   -   Original Discussion by os2mac
os2mac's Unix or Linux Image
os2mac os2mac is offline
Registered User
 
Join Date: Oct 2012
Last Activity: 13 December 2017, 6:19 PM EST
Location: Anchorage, AK
Posts: 248
Thanks: 22
Thanked 25 Times in 25 Posts
Quote:
Originally Posted by Don Cragun View Post
If a single prompt is issued, or if there are several prompts and they all require a "y" response, you can invoke it in a pipeline reading output from the yes utility.
so I tried the obvious

Code:
:~$ pfexec beadm destroy -f solaris-13|yes

but that did not appear to work.

can you give an example of correct usage?

thanks I've never heard of yes before.
    #4  
Old Unix and Linux 11-02-2017   -   Original Discussion by os2mac
RudiC's Unix or Linux Image
RudiC RudiC is offline Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 13 December 2017, 4:17 PM EST
Location: Aachen, Germany
Posts: 11,797
Thanks: 339
Thanked 3,659 Times in 3,357 Posts
As Don Cragun is offline, may I jump in? Reverse the pipe commands' sequence:
Code:
yes | pfexec beadm destroy -f solaris-13

The Following 2 Users Say Thank You to RudiC For This Useful Post:
Don Cragun (11-02-2017), os2mac (11-02-2017)
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Solaris live upgrade on Active boot environment Mr_Webster Solaris 4 12-05-2009 05:26 AM
Adding to boot-up environment DreamWarrior UNIX for Dummies Questions & Answers 1 07-13-2004 01:33 PM
automating CDE X applications from boot pkruse UNIX for Dummies Questions & Answers 1 06-27-2003 06:24 PM
automating CDE X applications from boot pkruse UNIX for Advanced & Expert Users 5 06-27-2003 12:19 PM



All times are GMT -4. The time now is 12:08 AM.