archive.sh.in
上传用户:weiyuanprp
上传日期:2020-05-20
资源大小:1169k
文件大小:1k
源码类别:

传真(Fax)编程

开发平台:

C/C++

  1. #! @SCRIPT_SH@
  2. #
  3. # This script is called by faxqclean to archive the job
  4. #
  5. JOBID=$1
  6. ARCHIVETO=archive/$JOBID
  7. FILETYPES="^!postscript:|^!tiff:|^!pcl:|^!pdf:|^!data:"
  8. QFILE=doneq/q$JOBID
  9. COMMLOGS=`find log -type f -name "c*"  -print | xargs -n50  grep -l "SEND FAX: JOB $JOBID"`
  10. DOCS=`grep -E $FILETYPES $QFILE | sed 's/.*://g'`
  11. NUMBER=`grep "^number:" $QFILE | sed 's/^number://g'`
  12. #
  13. # Default archiving is to create a directory in the archive directory 
  14. # named as the job number, move the q file and the doc files into it, and 
  15. # copy the associated logs and info file there, also.
  16. #
  17. mkdir $ARCHIVETO
  18. mv $QFILE $ARCHIVETO
  19. for log in $COMMLOGS; do cp $log $ARCHIVETO; done
  20. for doc in $DOCS; do cp $doc $ARCHIVETO; done
  21. if [ -r info/$NUMBER ]; then cp info/$NUMBER $ARCHIVETO; fi