Results 1 to 4 of 4
  1. #1
    Newcomer
    Join Date
    Jun 2012
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default win2008R2 using gnu grep/awk to find only inactive files

    Ok, running tsm on 2008R2, and I have the gnu awk and grep installed...I want to only capture inactive files inside of the backup...I can get this to work on linux, but because windows interprets " ' ` differently, i can't get it to print out right...Here's what I have:

    so basically here's the command

    F:\Program Files\Tivoli\TSM\baclient>dsmc q backup f:\* -subdir=yes -ina | grep "0 B" | awk "$1<=0"



    0 B 06/11/2012 13:55:09 STANDARD A \\virttsm\f$\db001
    0 B 06/11/2012 16:08:16 STANDARD A \\virttsm\f$\FILES
    0 B 06/11/2012 13:03:39 STANDARD I \\virttsm\f$\FILES
    0 B 06/11/2012 13:55:09 STANDARD A \\virttsm\f$\db001\SERVER1
    0 B 06/11/2012 13:55:09 DEFAULT A \\virttsm\f$\db001\SERVER1\SQLCRT.FLG
    0 B 06/11/2012 16:08:16 DEFAULT A \\virttsm\f$\FILES\dsmc
    0 B 06/11/2012 13:03:39 DEFAULT A \\virttsm\f$\FILES\file_1888
    0 B 06/11/2012 13:03:39 DEFAULT A \\virttsm\f$\FILES\file_1888 - Copy
    0 B 06/11/2012 13:03:39 DEFAULT A \\virttsm\f$\FILES\file_1888 - Copy (10)
    0 B 06/11/2012 13:03:39 DEFAULT A \\virttsm\f$\FILES\file_1888 - Copy (11)
    0 B 06/11/2012 13:03:39 DEFAULT A \\virttsm\f$\FILES\file_1888 - Copy (12)
    0 B 06/11/2012 13:03:39 DEFAULT A \\virttsm\f$\FILES\file_1888 - Copy (13)
    0 B 06/11/2012 13:03:39 DEFAULT A \\virttsm\f$\FILES\file_1888 - Copy (14)
    0 B 06/11/2012 13:03:39 DEFAULT A \\virttsm\f$\FILES\file_1888 - Copy (15)
    0 B 06/11/2012 13:03:39 DEFAULT A \\virttsm\f$\FILES\file_1888 - Copy (16)
    0 B 06/11/2012 13:03:39 DEFAULT A \\virttsm\f$\FILES\file_1888 - Copy (17)
    0 B 06/11/2012 13:03:39 DEFAULT A \\virttsm\f$\FILES\file_1888 - Copy (1
    0 B 06/11/2012 13:03:39 DEFAULT A \\virttsm\f$\FILES\file_1888 - Copy (19)
    0 B 06/11/2012 13:03:39 DEFAULT A \\virttsm\f$\FILES\file_1888 - Copy (2)
    0 B 06/11/2012 13:03:39 DEFAULT A \\virttsm\f$\FILES\file_1888 - Copy (20)
    0 B 06/11/2012 13:03:39 DEFAULT A \\virttsm\f$\FILES\file_1888 - Copy (21)
    0 B 06/11/2012 13:03:39 DEFAULT A \\virttsm\f$\FILES\file_1888 - Copy (3)
    0 B 06/11/2012 13:03:39 DEFAULT A \\virttsm\f$\FILES\file_1888 - Copy (4)
    0 B 06/11/2012 13:03:39 DEFAULT A \\virttsm\f$\FILES\file_1888 - Copy (5)
    0 B 06/11/2012 13:03:39 DEFAULT A \\virttsm\f$\FILES\file_1888 - Copy (6)
    0 B 06/11/2012 13:03:39 DEFAULT A \\virttsm\f$\FILES\file_1888 - Copy (7)
    0 B 06/11/2012 13:03:39 DEFAULT A \\virttsm\f$\FILES\file_1888 - Copy (
    0 B 06/11/2012 13:03:39 DEFAULT A \\virttsm\f$\FILES\file_1888 - Copy (9)


    then inside of unix i would just print where field 6 == I, any ideas inside of windows so that I only capture the I column

    thxs in adv

  2. #2
    Moderator moon-buddy's Avatar
    Join Date
    Aug 2005
    Location
    Somewhere in the US
    Posts
    5,951
    Thanks
    4
    Thanked 235 Times in 230 Posts

    Default

    dsmc q backup f:\* -subdir=yes -ina | grep "0 B" | awk '{print $7}'
    Ed

  3. #3
    Newcomer
    Join Date
    Jun 2012
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I forgot to mention that I need the file and it's state...IE, i need to know what files are 0bytes, and in the inactive state..

    Here's the output I need:
    0 B 06/11/2012 13:03:39 STANDARD I \\virttsm\f$\FILES1
    0 B 06/11/2012 13:03:39 STANDARD I \\virttsm\f$\FILES2
    0 B 06/11/2012 13:03:39 STANDARD I \\virttsm\f$\FILES3
    0 B 06/11/2012 13:03:39 STANDARD I \\virttsm\f$\FILES4

    etc etc

    Here's the command to get the 0 byte files, but I need a way to key off of the Inactive column...

    dsmc q backup f:\* -subdir=yes -ina | grep "0 B" | awk "$1<=0"
    Last edited by nextreme; 06-26-2012 at 03:11 PM. Reason: add more info

  4. #4
    Newcomer
    Join Date
    Jun 2012
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Here ya all go, remember this is for windows...
    Here it is, found on another forum, then modified...
    dsmc q backup f:\* -subdir=yes -ina | grep "0 B" | awk "$1<=0" | awk "{ if ($6 ~ /I/) print $0}"
    0 B 06/11/2012 13:03:39 STANDARD I \\virttsm\f$\FILES
    0 B 06/11/2012 13:03:39 STANDARD I \\virttsm\f$\FILES1
    0 B 06/11/2012 13:03:39 STANDARD I \\virttsm\f$\FILES2
    0 B 06/11/2012 13:03:39 STANDARD I \\virttsm\f$\FILES3

Similar Threads

  1. unable to find inactive files
    By unixandtsm in forum Backup / Archive Discussion
    Replies: 1
    Last Post: 03-02-2012, 05:31 PM
  2. Size of inactive files!
    By Mirdas_M in forum TSM Documentation,Tips and Tricks
    Replies: 1
    Last Post: 07-09-2008, 07:47 AM
  3. Query inactive files - delete specific files
    By xefil in forum Backup / Archive Discussion
    Replies: 5
    Last Post: 11-27-2006, 03:30 PM
  4. how to find when the deleted files become inactive in TSM
    By hping in forum Backup / Archive Discussion
    Replies: 1
    Last Post: 02-17-2005, 04:18 AM
  5. When are inactive files deleted?
    By kimon in forum TSM Server
    Replies: 1
    Last Post: 11-06-2002, 03:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •