Archive report of files just archived?

GMK1

Newcomer
Joined
May 10, 2018
Messages
4
Reaction score
0
Points
0
Hi! This may seem an obvious question I cannot find an answer to. We are just getting started with archiving files, and I'd like to set this up automated. I have the command to run, and it will run each month, but each month I'd like to have it spit out a report of all the files it archived that run? So basically there'd be one file a month generated for each time we run the archive. That file should contain the files archived that month. Can someone help me figure out the syntax needed for that? This is a sample of what I'm running: dsmc archive h:\Archive\Finance\1yr\* -sub=yes -archmc=arc1year -desc='Finance' -optfile=G:\Backup\TSM\BAclient\dsm_fileshare-arc.opt
 
Just redirect the output to a file:
dsmc archive h:\Archive\Finance\1yr\* -sub=yes -archmc=arc1year -desc='Finance' -optfile=G:\Backup\TSM\BAclient\dsm_fileshare-arc.opt > output.txt

Or, you can use the options AUDITLOGGINGand AUDITLOGNAME in your command to do this.

Or, if you schedule it from the server, this will be written to the schedlog, you can specify a schedlog for this one, you'd need a 2nd scheduler too to use dsm_fileshare-arc.opt
 
Good information, I'll try these options. Thank you so much for the reply
 
If you need to query directly from the TSM server, something I whipped up for my auditing needs.
As with most things its its quick and dirty but works decently enough :)
Requires KSH.

Code:
#!/bin/ksh
#Global Variables
TSMADMIN=<Admin_ID>
TSMSE=<server>
TSMPA=<password>

# Function to call tivoli!
tsmcmd() {
    dsmadmc -se=${TSMSE} -id=${TSMADMIN} -pa=${TSMPA} -dataonly=yes "$*"
}


is_node() {
    tsmcmd "q node $x" | grep -q $x
    if [ $? -eq 0 ]; then
        ISNODE="TRUE"
        echo "Node $x is here"
    else
        ISNODE="FALSE"
        echo "Node $x does not exist"
        exit 1

    fi
}


echo "Please enter the node you want archive list for: "
# Read input
typeset -u x
read x
# Null selection, exit
if [ -z "$x" ]; then
    echo "Invalid selection"
    exit 1
fi

is_node "$x"
if [ $ISNODE == "TRUE" ]; then
    tsmcmd "select filespace_name||hl_name||ll_name as \"Full name\" from archives where node_name='$x'" | sed '/^$/d' > $x.archive.txt
    echo "File $x.archive.txt should be created in your cwd."
fi
 
Nice script, thank you for sharing, I will give that a try as well!
 
Back
Top