Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- WORKDIR=/www/htdocs/w00ebf51/wete/public_html/cam/pix
- TARGETDIR=/www/htdocs/w00ebf51/wete/public_html/camarchiv/$(date +%F)
- CURRENTSEC=$(date +%s)
- THRESHOLD=$(echo $((${CURRENTSEC} - 86400)))
- mkdir $TARGETDIR
- for CURRENTFILE in $WORKDIR/*.jpg; do
- FILETIME=$(ls $CURRENTFILE -gG --time-style=+%s |cut -d' ' -f4)
- if [ ${FILETIME} -le ${THRESHOLD} ]; then
- cp ${CURRENTFILE} ${TARGETDIR}
- fi
- done
- tar cjf ${TARGETDIR}.tar.bz2 ${TARGETDIR}
- rm -rf ${TARGETDIR}
Add Comment
Please, Sign In to add comment