# # Copy a file and log the copier in a pco.log file. # # Usage: # pco source-file destination-file # # These are the same two argments as UNIX cp. Note that only two arguments can # be given, so pco of multiple files must be done with separate pco commands # (e.g, use a foreach). # # Project group leaders should specialize this file to log check outs to a # group directory instead of the global projects directory. # # WARNING: This script writes a temp file to /tmp/testing-pco-results. The # file is deleted at the end of the script. If the script is aborted prior to # completion, the temp file must be manually removed. # if ($3 != "") then echo "Usage: pco source-file destination-file" echo " I.e., there must be exactly two arguments." echo "" exit endif echo "" echo WARNING: This script writes a temp file to /tmp/testing-pco-results. The echo file is deleted at the end of the script. If the script is aborted prior echo to completion, the temp file must be manually removed. echo "" set logfile = ~/projects-work/enchilada/administration/pco.log set tmpfile = /tmp/pco-results set w = `whoami` set d = `date` set f = $1 cp $1 $2 |& tee $tmpfile if (-z $tmpfile) then echo $w $d $f >> $logfile endif rm -f $tmpfile