I have a script that sends managers an email when their subordinates mailboxes are above 95% full.
It basically builds a tmp file in /tmp that contains massaged output of zmprov gqu localhost.
If I run the script AS ZIMBRA USER from the terminal it runs as expected every time including putting the contents of the temp file in the form email.
If I schedule the script as Zimbra user (crontab -e as zimbra), the script runs fine and generates the email but the contents of the temp file dont get appended.
I have tried moving the tmp files out of the tmp folder and into the same folder I am running the script from, but same results.
script completes 100% manually but not when scheduled
- JDunphy
- Outstanding Member
- Posts: 901
- Joined: Fri Sep 12, 2014 11:18 pm
- Location: Victoria, BC
- ZCS/ZD Version: 9.0.0_P39 NETWORK Edition
Re: script completes 100% manually but not when scheduled
Could be a few things... try adding this after your #!/bin/bash
This will setup the environment and is how many other zimbra cron job scripts do it. You can also look in the cron logs for the exact error message.
Jim
Code: Select all
source `dirname $0`/zmshutil || exit 1
zmsetvars
Jim