Results 1 to 2 of 2

Thread: How do I run scripts via cron with SU'ing?

  1. #1
    Join Date
    Mar 2012
    Rep Power

    Angry How do I run scripts via cron with SU'ing?

    Hi everyone,
    This answer might be painfully obvious and I just don't know enough about linux to appropriately search for it but I can't figure out how to run a zm command (zmprov, etc) via script without SU'ing and inputting a password first.

    To keep things simple, let's say that I wanted to run this script from a cron job:
    zmcontrol status > /var/tmp/status.blah
    I know there's something about making sure the environment is correct and/or setting something in the sudoers file but nothing I do makes a difference.

    Any help would be appreciated -thanks

  2. #2
    Join Date
    Apr 2008
    New Paltz, NY
    Rep Power


    This isn't exactly answering your question but...

    I would just run zimbra's scripts within the crontab file for the zimbra users. Just put your own custom stuff after the # ZIMBRAEND comment.

    As for your specific question, instead of using su I would instead use sudo. There's a lot out there on setting up and using sudo. If you need assistance with that, I'd recommend checking more of a general purpose linux forum than this one.
    Paul Chauvet
    State University of New York at New Paltz

Similar Threads

  1. Permission Denied error in logs
    By mutuku in forum Administrators
    Replies: 0
    Last Post: 02-01-2012, 02:24 PM
  2. [SOLVED] ldap errors on zimbra start
    By jimbo in forum Administrators
    Replies: 1
    Last Post: 01-14-2008, 09:51 AM
  3. zmbackup - run before / run after scripts?
    By fisch09 in forum Administrators
    Replies: 2
    Last Post: 11-06-2007, 12:43 PM
  4. Problems with Zimbra Cron Jobs
    By soxfan in forum Administrators
    Replies: 9
    Last Post: 08-22-2006, 10:02 AM
  5. Run own PHP scripts on the server
    By goetzi in forum Developers
    Replies: 11
    Last Post: 12-30-2005, 11:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts