Why Cron works, but nothing happens when launch bash script?
Posted: Sun Jun 17, 2018 2:14 pm
I created bash script "auto-gzip.sh" to zip my public files:
Added this file to cron via Vesta interface:
Try this command manually - it works good. But it doesn't work via Cron although logs are added every minute:
So, Cron works, but nothing happens. Why?
Code: Select all
#!/bin/bash
cd /home/admin/web/site.com/public_html/
find . -name "*.gz" -type f -delete
gzip -kfr --best .
Code: Select all
sudo bash /home/admin/web/site.com/scripts/auto-gzip.sh
Code: Select all
Jun 17 09:11:01 source CRON[6307]: (admin) CMD (sudo bash /home/admin/web/site.com/scripts/auto-gzip.sh)