daily pastebin goal
49%
SHARE
TWEET

Untitled

a guest May 16th, 2018 101 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. WORKDIR=/www/htdocs/w00ebf51/wete/public_html/cam/pix
  4. TARGETDIR=/www/htdocs/w00ebf51/wete/public_html/camarchiv/$(date +%F)
  5. CURRENTSEC=$(date +%s)
  6. THRESHOLD=$(echo $((${CURRENTSEC} - 86400)))
  7.  
  8. mkdir $TARGETDIR
  9.  
  10. for CURRENTFILE in $WORKDIR/*.jpg; do
  11. FILETIME=$(ls $CURRENTFILE -gG --time-style=+%s |cut -d' ' -f4)
  12. if [ ${FILETIME} -le ${THRESHOLD} ]; then
  13. cp ${CURRENTFILE} ${TARGETDIR}
  14. fi
  15. done
  16.  
  17. tar cjf ${TARGETDIR}.tar.bz2 ${TARGETDIR}
  18. rm -rf ${TARGETDIR}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top