(I'm going backwards in a hurry, first I can't telnet to localhost,)
now, my script gives this:
sudo: sorry, you must have a tty to run sudo
I'm trying to run this from cron, the script has like*1:
googling gives different solutions, hence my q
2nd Question
the dir tree is like
/var/../%d/%u1/
/var/../%d/%u2/
I need to pick the target directories '%u', that works, BUT, after a pass,
I end up with gzip files as well as directories, on next pass, script
picks up directories and gzip files, not wanted
how do I modify so I only pass directory names, NOT file names in $j
thanks for any pointers
*1---------
#!/bin/bash
case $# in
1)
DOMAIN=$1
;;
*)
echo "Usage: $0 <domain.name>" 1>&2
echo "this archives" $1 " Maildirs "
echo "all mail over 45 days is gzipped"
exit
;;
esac
if [ -s /var/mail/vhosts/$1 ] ; then
cd /var/mail/vhosts/$1
for j in *@*
do
sudo -u#5000 /usr/local/bin/archivemail -d45 $j
done
exit
fi
echo "no such domain" $i
exit
-----------------
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html