Skip to content

Commit

Permalink
ism_get_snap: Deleting snapfile on ISM-VA
Browse files Browse the repository at this point in the history
  • Loading branch information
HMBJOrth committed Mar 8, 2023
1 parent 03cc923 commit 872b79d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
10 changes: 6 additions & 4 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:author: Jürgen Orth
:email: Juergen.Orth@Fujitsu.com
:version: v1.0.8
:version: v1.0.9

:imagesdir: img/
:toc: preamble
Expand Down Expand Up @@ -33,6 +33,7 @@ IMPORTANT: *#Please note: This toolset is provided W/O ANY WARRANTY and is to be
[cols="5%,10%,65%,20%"]
|=================
|Version|Date|Description|Author
|1.0.9|2023-03-08|+ `ism_get_snap`: Snapfile will be deleted on ISM-VA after it has been downloaded.|mailto:{email}[{Author}]
|1.0.8|2023-03-03|+ Added missing command in commandlist of README|mailto:{email}[{Author}]
|1.0.7|2023-02-28|
* New commands `ism_get_groupname`, `ism_get_snapfile`, `ism_copy_2ds` +
Expand Down Expand Up @@ -199,7 +200,7 @@ Deletes given ISO. Without param the command runs in interactive mode.
----
#!/bin/bash
# (c) Juergen Orth ;-)
# $Id: README.adoc 172 2023-03-03 07:44:09Z HMBJOrth $
# $Id: README.adoc 173 2023-03-08 13:18:15Z HMBJOrth $
# for documentation see https://github.com/fujitsu/ISMtools
#
# Settings and tools for ISMtools based on bash and curl
Expand Down Expand Up @@ -662,7 +663,7 @@ $ ism_get_sysrep EWAL001056

[[ism_get_snap]]
==== `ism_get_snap [-t <days>] [-m part|full] [-c]`
Creates and downloads an ISM snap file (ZIP format) that can be used for support issues. You can specify the period in _days_ of log files that should be retrieved by parameter `-t`. If no time spec is given then default value _SNAPDAYS_ defined in <<Configfile>> is used. Using `-m` option allows to define whether to generate a full or a partial snap. Default _SNAPMODE_ is defined in <<Configfile>>. With option `-c` the snap file is copied afterwards to Fujitsu\'s SFTP server to directory `/incoming`.
Creates and downloads an ISM snap file (ZIP format) that can be used for support issues. You can specify the period in _days_ of log files that should be retrieved by parameter `-t`. If no time spec is given then default value _SNAPDAYS_ defined in <<Configfile>> is used. Using `-m` option allows to define whether to generate a full or a partial snap. Default _SNAPMODE_ is defined in <<Configfile>>. With option `-c` the snap file is copied afterwards to Fujitsu\'s SFTP server to directory `/incoming`. After downloading the snap file to your local machine it is deleted at the ISM-VA.

[source,shell,indent=8]
----
Expand All @@ -674,7 +675,8 @@ $ ism_get_snap -m full -t 2
2023-02-28 10:17:25 -- Complete Success
2023-02-28 10:17:30 -- Starting download of snapfile ...
2023-02-28 10:17:30 -- Snapfile ismsnap-77-20230228101537-20230226-20230301-20230226-20230301-full.zip (Size=13M/Type=ZIP)
2023-02-28 10:17:30 -- Logging out
2023-02-28 10:17:31 -- Deleting snapfile on ISM_VA
2023-02-28 10:17:35 -- Logging out
----

[[ism_copy_2ds]]
Expand Down
Binary file renamed doc/ISMtools v1.0.8.pdf → doc/ISMtools v1.0.9.pdf
Binary file not shown.
10 changes: 9 additions & 1 deletion scripts/ism_get_snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
# (c) Juergen Orth ;-)
# $Id: ism_get_snap 171 2023-02-28 13:54:46Z HMBJOrth $
# $Id: ism_get_snap 173 2023-03-08 13:18:15Z HMBJOrth $
# for documentation see https://github.com/fujitsu/ISMtools

. ${0%/*}/.ism_env
Expand Down Expand Up @@ -50,6 +50,14 @@ echo 'user = "'$ISM_USER'"' | curl -K - -o ${file##*/} -k $CURLOPTIONS $file
SIZE=$(ls -lGh ${file##*/} | awk '{print $4}')
showinfo " Snapfile ${file##*/} (Size=$SIZE/Type=ZIP)"

showinfo "Deleting snapfile on ISM_VA"
ism_cmd post system/settings/file/delete -d '
{
"IsmBody": {
"Path": "'${file#ftp://*/}'"
}
}' | jq '.MessageInfo[].Message'

if [ $KEEPSESSION == false ]
then
showinfo "Logging out"
Expand Down

0 comments on commit 872b79d

Please sign in to comment.