Automating old Boot Environment Cleanup Solaris 11


 
Thread Tools Search this Thread
Operating Systems Solaris Automating old Boot Environment Cleanup Solaris 11
# 1  
Old 11-02-2017
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
# 2  
Old 11-02-2017
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.
This User Gave Thanks to Don Cragun For This Post:
# 3  
Old 11-02-2017
Quote:
Originally Posted by Don Cragun
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 11-02-2017
As Don Cragun is offline, may I jump in? Reverse the pipe commands' sequence:
Code:
yes | pfexec beadm destroy -f solaris-13

These 2 Users Gave Thanks to RudiC For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Solaris

T5-4 Bootloop with 11.4 Boot Environment

TLDR: Patched a separate boot environment to 11.4. Activated and rebooted the system only to have it boot loop and show 11.3 on the patched boot environment. Bootloop process: The system went down, came up showing 11.3 then spewed bunch of errors and resetted. SEE BELOW FOR THE FINAL MSG... (1 Reply)
Discussion started by: samthewildone
1 Replies

2. UNIX for Beginners Questions & Answers

Lucreate Fails to Create Boot Environment;

My OS solarius 5.10 Generic_147148-2 i86 Error: please review new boots environments using options 1. Solution - show me the commands Partition is full, try to remove some unneeded files, then try to compress some other unneeded files. man command creates a temp file under... (0 Replies)
Discussion started by: zbest1966
0 Replies

3. Solaris

Restoring to previous Boot Environment

Hi all, I'm fairly new to Solaris and am just getting to grips with using LU (Live Upgrade) for OS patching purposes. worcester#uname -a SunOS worcester 5.10 Generic_144488-12 sun4v sparc SUNW,SPARC-Enterprise-T5220I have successfully created and patched a new BE (boot environment) using the... (5 Replies)
Discussion started by: polo_mint4
5 Replies

4. Solaris

Solaris live upgrade on Active boot environment

Hi, Is it possible to perform an luupgrade on the active boot environment in Solaris? I want to perform this on BEAlpha - the disk that has BEOmega will be unavailable whilst performing the upgrade but I still want to install the patches using luupgrade. Boot Environment Is... (4 Replies)
Discussion started by: Mr_Webster
4 Replies

5. UNIX for Dummies Questions & Answers

Messed up my boot environment or root profile

Ok, a couple weeks ago I was fixing a cron report about perl not happy with 'locale' info (LANG and LC not set). As a result, I was experimenting with setting the correct 'locale' in several areas (like /etc/sysconfig/i18n and who knows where). Somehow after a reboot, as soon as the OS starts... (3 Replies)
Discussion started by: Garball
3 Replies

6. UNIX for Dummies Questions & Answers

Adding to boot-up environment

During the boot-up process *nix runs scripts linked into the runlevel directories rc#.d. What I'm wondering is, how do I control the environment that those scripts see? I need to set a couple environment variables, and I can NOT do it from within the scripts because it poses a maintenance nightmare... (1 Reply)
Discussion started by: DreamWarrior
1 Replies

7. UNIX for Dummies Questions & Answers

automating CDE X applications from boot

How do I do it? I am trying to automate an application that requires an X window from boot. help!!! (1 Reply)
Discussion started by: pkruse
1 Replies

8. UNIX for Advanced & Expert Users

automating CDE X applications from boot

Ok, ... I tried posting this in the beginner's forum, but maybe that wasnt the right place. Does anyone know how to automate CDE X applications from boot? If I use the rc2 folder, the programs start in the background with no X window. I am stumped. any suggestions? (5 Replies)
Discussion started by: pkruse
5 Replies
Login or Register to Ask a Question