To begin, create a new working directory (ex: ~/hsi_copy_work) on the system you will perform this work (Theia/WCOSS/JET) and cd to it to keep all of the files needed for this process in the same place. 1. Get expired data file from HPSS. [root@xcore Skylar]# hsi get /Expired_Data_Lists/expired.2017-07.txt 2. Grep name from list to obtain complete list of files [root@xcore Skylar]# grep "Li.Bi" expired.2017-07.txt |wc -l 28 [root@xcore Skylar]# grep "Li.Bi" expired.2017-07.txt > files.list 3. Determine which tape each file resides. [root@xcore Skylar]# for i in `cat files.list |awk '{print $3}'`; do echo "$i `hsi -qP ls -V $i |grep "PV List"|awk '{print $5}'`"; done >> files.list_wTapes [root@xcore Skylar]# less files.list_wTapes /1year/NCEPDEV/emc-da/Li.Bi/WCOSS/para.tar.old N1379400 /1year/NCEPDEV/emc-da/Li.Bi/WCOSS/CRTM.tar N1399300 /1year/NCEPDEV/emc-da/Li.Bi/WCOSS/Q3FY16_global.tar N1399600 /1year/NCEPDEV/emc-da/Li.Bi/WCOSS/prIRctl/2015052400gdas.tar.idx N1388500 /1year/NCEPDEV/emc-da/Li.Bi/WCOSS/prIRctl/2015052400gdas.tar N1385400 /1year/NCEPDEV/emc-da/Li.Bi/WCOSS/prIRctl/2015052400gdas.enkf.anl.tar.idx N1388200 /1year/NCEPDEV/emc-da/Li.Bi/WCOSS/prIRctl/2015052400gdas.enkf.anl.tar N1385800 /1year/NCEPDEV/emc-da/Li.Bi/WCOSS/prIRctl/2015052400gdas.enkf.obs.tar.idx N1388300 /1year/NCEPDEV/emc-da/Li.Bi/WCOSS/prIRctl/2015052400gdas.enkf.obs.tar N1388300 /1year/NCEPDEV/emc-da/Li.Bi/WCOSS/prIRctl/2014051118gdas.tar.idx N1388500 /1year/NCEPDEV/emc-da/Li.Bi/WCOSS/prIRctl/2014051118gdas.enkf.anl.tar.idx N1388500 /1year/NCEPDEV/emc-da/Li.Bi/WCOSS/prIRctl/2014051118gdas.tar N1388500 /1year/NCEPDEV/emc-da/Li.Bi/WCOSS/prIRctl/2014051118gdas.enkf.anl.tar N1388500 /1year/NCEPDEV/emc-da/Li.Bi/WCOSS/prIRctl/2014051118gdas.enkf.obs.tar.idx N1388500 /1year/NCEPDEV/emc-da/Li.Bi/WCOSS/prIRctl/2014051118gdas.enkf.obs.tar N1388500 /1year/NCEPDEV/emc-da/Li.Bi/WCOSS/prIRctl/2014051200gdas.tar.idx N1381200 4. Group files on the same tapes into the same input files. [root@xcore Skylar]# for i in `cat files.list_wTapes|awk '{print $2}'|sort -n|uniq`; do grep $i files.list_wTapes |awk '{print $1}' > $i.tapefiles; done [root@xcore Skylar]# ls -1 *tapefiles N1159300.tapefiles N1186300.tapefiles N1189400.tapefiles N1190200.tapefiles N1192200.tapefiles N1379400.tapefiles N1381200.tapefiles N1384000.tapefiles N1385400.tapefiles N1385600.tapefiles N1385800.tapefiles N1385900.tapefiles N1388200.tapefiles N1388300.tapefiles N1388500.tapefiles N1399300.tapefiles N1399600.tapefiles 5. Create input file for copies to new directory. These input files will copy the expiring files to the new retention directory. [root@xcore Skylar]# mkdir input_files [root@xcore Skylar]# for i in `ls -1 *tapefiles`; do echo "log $i.output" >> input_files/$i.in; cat $i |awk '{print "copy -pPS "$1" ""/"$1}' >> input_files/$i.in; sed -i 's/\/\/1year\/NCEPDEV/\/5year\/NCEPDEV/g' input_files/$i.in; done [root@xcore Skylar]# cd input_files [root@xcore input_files]# cat N1186300.tapefiles.in log N1186300.tapefiles.output copy -pPS /1year/NCEPDEV/emc-da/Li.Bi/WCOSS/pr4dev_initial/pr4dev.2015092300.tar /5year/NCEPDEV/emc-da/Li.Bi/WCOSS/pr4dev_initial/pr4dev.2015092300.tar 6. Kick off HSI from your input file dir to copy data [root@xcore input_files]# for i in `ls -1`; do hsi in $i; done 7. Review the $.output files and search for any errors. You can also verify some of the files in the new location with hsi ls -l /path/to/file.