ONTAP Discussions

How to delete a snapshot without confirmation from Command Line?

zimmerm
23,029 Views

Just not getting this.....

 

How do I delete groups of snapshots without confirmation in Ontap v8.3   ???

 

partial script is:

ssh@filer snapshot delete -vserver xxx -volume yyy -snapshot zzz

 

where ZZZ is a string feed list

and ZZZ keeps asking me for confirmation.

 

 

Thanks!

1 ACCEPTED SOLUTION

Sandeep17it
22,923 Views
You can set the confirmations to off and this will not prompt for any confirmation, you can do it by using the command set and press tab you will get an option for confirmation and you can turn it to off

View solution in original post

4 REPLIES 4

michael_england
22,978 Views

I'm not entirely sure if you need diag mode, but a

 

set diag and then your command with -force true should work

 

so, something like this:

 

"set diag; snapshot delete -vserver xxx -volume yyy -snapshot zzz -force true"

Sandeep17it
22,924 Views
You can set the confirmations to off and this will not prompt for any confirmation, you can do it by using the command set and press tab you will get an option for confirmation and you can turn it to off

zimmerm
22,855 Views

How do you set the "-confirmations off" permanently for snapshot deletes....?

 

The    command set TAB     works but only for that active ssh session

 

snap

snapshot>

snapshot><CR>

 

Confirmation Messages:  on

 

snapshot> set ?

snapshot> set -privilege admin -confirmation off

snapshot><CR>

 

Confirmation Messages:  off

 

this works as long as the SSH session is still open, when you logout and log back in, the -confirmation is set to "on" again.

 

 

If I'm running a script from Solaris and SSHing every hour to check for "current" snapshots that got created by an application, which under some key trigger I do not want,

then I want to delete that snapshot within the script, without the confirmation.

RaviChandra
20,185 Views

It worked..Thanks.

 

First i turned off the confiramation using Admin mode in PRIV..

 

Next Prepared a script and executed all. It eased my work.

 

snapshot show -vserver XXXX -volume XXXX -snapshot * -create-time <365d -fields create-time,size -is-7-mode true 

 

 

Public