Welcome, Guest
Username Password: Remember me

crontab condition, if a file size is more than 5000K than send an emai
(1 viewing) (1) Guest
Shell Script
  • Page:
  • 1

TOPIC: crontab condition, if a file size is more than 5000K than send an emai

crontab condition, if a file size is more than 5000K than send an emai 10 months, 3 weeks ago #669

  • scmuser
  • OFFLINE
  • Gold Boarder
  • scm master
  • Posts: 237
  • Points: 3429
  • Karma: 0
  • Honor Medal 2009
find /var/www/vhosts/domain/folder/ -name '*.flv' -size +5000k | grep flv && /bin/mail -s "The file is available!" " This e-mail address is being protected from spambots. You need JavaScript enabled to view it " > /dev/null


If grep detects a line containing the string flv in the output of find it returns 0, otherwise 1. The mail command will only be executed on exit code 0 of grep.
  • Page:
  • 1
Time to create page: 0.47 seconds

     
    
Home Forum