Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

The script works fine when executed manually but I recived the folloing error while it's run as a cron job: xargs: postsuper: No such file or directory

#!/bin/bash

mailgueue=$(mailq | awk '/MAILER-DAEMON/ { print $1 }' | wc -l)

if [ $mailgueue -ge 1 ]
    then
/usr/bin/mailq | awk '/MAILER-DAEMON/ { print $1 }' | xargs -n 1 postsuper -d

fi
share|improve this question

1 Answer 1

up vote 4 down vote accepted

Provide the full path to postsuper in your script. It's probably just not in cron's $PATH.

share|improve this answer
    
It didn't help however I just completely removed the xargs command and it works fine. –  HTF Aug 7 '12 at 12:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.