$!
$! Copy and load T4 informations into Rdb database t4_rdb
$!
$!-----------------------------------------------------------------------------
$!      
$! need logicals T4_TEMP, T4_ROOT, T4_DATA
$!
$!-----------------------------------------------------------------------------
$! Get the .zip files
$!
! Build the yesterday date
$!                      
$ schema = "''p1'"
$ machine = "''p2'"
$ if "''P3'" .eqs. ""
$ then
$   day=f$cvtime("yesterday","absolute","day") 
$   month=f$cvtime("yesterday","absolute","month") 
$   year=f$cvtime("yesterday","absolute","year") 
$   date = day+month+year 
$ else
$   date = "''p3'"
$ endif
$!
$ del t4_temp:*.*;* /log
$ @python_vms:setup
$ copy [.data]*'machine'*'date'*.zip t4_temp: /log
$!
$! Unzip files
$! 
$!  unzip = "$t4_root:[loader]unzipi64.exe"
$  unzip t4_temp:* -d t4_temp:                     
$!
$! Convert disks data
$!
$  fichier = f$search("t4_temp:*''machine'*disk*.csv")
$  python t4_root:[loader]t4_disks2t4.py 'fichier' -
   t4_temp:conv_'machine'_'date'_disk.cvs           
$!
$! Store data in database
$!
$  fichier = f$search("t4_temp:*''machine'*.csv")
$  python t4_root:[loader]t4_loader_v3.py -brdb -d'schema' -rt4_rdb 'fichier'
$!
$  python t4_root:[loader]t4_loader_v3.py -brdb -d'schema' -
   -rt4_rdb t4_temp:conv_'machine'_'date'_disk.CVS
$!
$! Delete .zip files in t4_temp
$!
$  del t4_temp:*.zip;* /log                                
$!
$! Copy others files from t4_temp to t4_data
$!
$  copy t4_temp:*.* t4_data:*.*  /log
$!
$! Delete all files in t4_temp
$!
$  del t4_temp:*.*;* /log
$!
$!
$fin:
$! 
$! Purge files in t4_data, keep 30 days of stats
$!
$ del t4_data:*.*;* /before=today"-30-00"
$!
$ exit
$!
