I have a short script (which I think? used to work on the old server...) that I'm having problems with:
I want to run archivemail against all mailboxes in: /var/mail/vhosts/domain.tld/*@domain.tld this is what I need to run: :/var/mail/vhosts/aa.com.au# sudo -u#5000 archivemail -d90 [email protected] the script fails with # archmail aa.com.au /usr/local/bin/archmail: line 19: syntax error near unexpected token `sudo' /usr/local/bin/archmail: line 19: ` sudo -u#5000 archivemail -d90 $j ' script: ---------------------------------- # cat /usr/local/bin/archmail #! case $# in 1) DOMAIN=$1 ;; *) echo "Usage: $0 <domain.name>" 1>&2 echo "this archives" $1 " Maildirs " echo "all mail over 90 days is gzipped" exit ;; esac if [ -s /var/mail/vhosts/$1 ] ; then cd /var/mail/vhosts/$1 for j in *@* sudo -u#5000 archivemail -d90 $j done exit fi echo "no such domain" $1 exit --------------------------- (I should really know by now how to do this...) -- Voytek -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
