2

I have created the below file in /etc/cron.d/

-rw-r--r--   1 root root   81 2011-07-10 14:56 foswiki

...and copied the below into the file:

* * * * * cd /var/lib/foswiki && perl -I bin tools/mailnotify -user AdminUser -q

I assumed that this would run every minute. It does not appear to run at all however. The script is part of a Foswiki installation (likely irrelevant to the question) and does run manually, which leads me to think I've done something wrong in setting up the above. Is it a file permissions issue? Any help is appreciated. Thanks.

1 Answer 1

4

For system-wide (non-user) crontab files, you need to specify a username to run the command with its permissions. For example:

* * * * * root cd /var/lib/foswiki && perl -I bin tools/mailnotify -user AdminUser -q

The above example will run your comman with the permissions of the root user, if you want to change that replace root with some other username.

3
  • Thanks, I didn't know that. In this case it had no effect however. Useful to know though. Thanks.
    – Tim
    Jul 10, 2011 at 15:38
  • Make your file executable: chmod 0755 /etc/cron.d/foswiki. Jul 10, 2011 at 15:47
  • Thanks, Still no luck. I guess it's something else that's the problem. I'll close this. unresolved. Thanks.
    – Tim
    Jul 10, 2011 at 19:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .