Category Archives: Cron

Optimize images in CRON job

Google PageSpeed Insights may complain about images being not compressed enough. There are techniques which ensure lossless compression. When using JPG images you may compress them using jpegoptim, which may be run from the command line.

jpegoptim -s /var/www/html/images/*.jpg

The command will go through all jpg images in that folder and will perform lossless compression. The -s parameter will also ensure that all markers (eg. comments and EXIF data) will be removed.

How to disable Cron e-mails in Webmin

Today I have setup some Cron job. The command is running under user nobody. After some minutes while this job has been running and executed I received e-mail with result of the job. This job was setup to run every 3 minutes, so I was getting those e-mails quite often.
After I have logged into Webmin to disable those e-mails I have noticed that there is no option to disable those e-mail notifications. Looks like it depends on the user under which the job is executed if he has some e-mail or not.
Anyway you can disable those e-mails by going to Scheduled Cron Jobs. On the page click on Create a new environment variable button. Select the same user as the one under which the job is running. As Variable name use MAILTO and do not fill anything into the Value field. Also make sure you leave Before all Cron jobs for user selected.
Finally you should not get any new e-mails 🙂