001 #!/bin/sh
002 # useage example:
003 #>tar -cvzf checkFs.tgz checkFs.sh
004 #>Cafcom ./checkFs.tgz fkw@fcdflnx3.fnal.gov:tmp.tgz fkw@fnal.gov test 1 1 checkFs.sh top fcdfdata050 quota
005 #
006 # This example would give me the quota of top acount on fcdfdata050.
007 # Note: you need to have access to the account on the server you are trying to get to.
008 # This means your caf principle has to be in the .k5login file of the account that you are trying to
009 # access.
010 #
011 # Other useful examples:
012 #>Cafcom ./checkFs.tgz fkw@fcdflnx3.fnal.gov:tmp.tgz fkw@fnal.gov test 1 1 checkFs.sh top fcdfdata050 "df -h"
013 #>Cafcom ./checkFs.tgz fkw@fcdflnx3.fnal.gov:tmp.tgz fkw@fnal.gov test 1 1 checkFs.sh top fcdfdata050 "du -sh /cdf/scratch/* "
014
015
016 export PATH=/usr/krb5/bin:/usr/bin:/bin:${PATH}
017
018 echo "user = "$1
019 echo "fileserver = "$2
020 echo "command = "$3
021
022 /usr/krb5/bin/rsh -N -l $1 $2 $3 > rshLog.log 2>&1
023
024 #if you are a lazy bum like me, and don't want to bother picking up your output as a tarfile, you can send
025 #it straight to yourself as follows:
026 #/usr/krb5/bin/rcp rshLog.log fkw@fcdflnx3.fnal.gov:.
027
028 rm -f ./checkFs.sh
029
Send problems or questions to cdfcode@fnal.gov