scmuser created the topic: crontab condition, if a file size is more than 5000K than send an email
find /var/www/vhosts/domain/folder/ -name ‘*.flv’ -size +5000k | grep flv && /bin/mail -s “The file is available!” “my@address.com” > /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.
Latest posts by Rajesh Kumar (see all)
- How to save 80% of the Treatment Cost using Medical Tourism? - January 13, 2025
- Best AI tools and websites to travel blogger or travel video & audio creator - January 12, 2025
- Deep Dive & Troubleshoot using Kubernetes logs & its Structure & Location - January 12, 2025