Hi Team,
I have written commands to delete and create snapshots on Solaris Server
When I run these commands directly on server then they are working fine but when ran thru bigfix they are failing
Please check and suggest
ZFS snapshot deletion:
zfs list -H -o name -t snapshot |grep rpool |xargs -n1 zfs destroy
zfs snapshot creation :
zfs list -H -o name | grep rpool |egrep -v “dump|export|swap|DUMP|@” |awk ‘{print $1"@b4patch"}’ >t1
cat t1 |xargs -n1 zfs snapshot
Reg
Suresh
Hi
Can you provide the BigFix actionscript you are currently using to run these commands?
HI Strawgate
I am using below script run command
delete /var/opt/BESClient/commands-output.txt
delete appendfile
appendfile #!/bin/bash
appendfile echo “Delete snapshot” >> /var/opt/BESClient/commands-output.txt
appendfile zfs list -H -o name -t snapshot |grep rpool |xargs -n1 zfs destroy >> /var/opt/BESClient/commands-output.txt
appendfile echo “Create snapshot” >> /var/opt/BESClient/commands-output.txt
appendfile zfs list -H -o name | grep rpool |egrep -v “dump|export|swap|DUMP|@” |awk ‘{print $1"@b4patch"}’ >t1 >> /var/opt/BESClient/commands-output.txt
move __appendfile myscript.sh
run chmod 777 myscript.sh
wait bash myscript.sh
delete myscript.sh
What are the results of the commands (written to in commands-output.txt)?
When it fails what errors or conditions that result?
From the documentation: (http://docs.oracle.com/cd/E19253-01/819-5461/6n7ht6r4f/):
A dataset cannot be destroyed if snapshots of the dataset exist. For example:
# zfs destroy tank/home/ahrens
cannot destroy 'tank/home/ahrens': filesystem has children
use '-r' to destroy the following datasets:
tank/home/ahrens@tuesday
tank/home/ahrens@wednesday
tank/home/ahrens@thursday
In addition, if clones have been created from a snapshot, then they must be destroyed before the snapshot can be destroyed.
For more information about the destroy subcommand, see Destroying a ZFS File System.
Hi Ninja,
When I run these commands directly on server then they are working fine
Oracle team provided the command ZFS snapshot deletion and zfs snapshot creation
When ran thru bigfix they are failing there no error fond status showing Failed
Let me know required any Log file.
Thanks,