[Novalug] bash scripting
Richard Rognlie
rrognlie at gamerz.net
Fri Jun 1 18:02:46 EDT 2007
On Fri, Jun 01, 2007 at 05:35:41PM -0400, Miguel Gonzalez Castaños wrote:
> Hi,
>
> I want to launch a command using nohup in a bash script, and when the
> command has finished send an email with the log file. I prefer not to
> have to type nohup script.sh & and be able to wait inside my script.sh :
>
> nohup command > log &
>
> mail -s "subject" email at address < log
>
> I have googled but I can't figure it out
Try something like...
( command | tee log | mail -s "subject" email at address ) </dev/null >/dev/null 2>/dev/null &
--
/ \__ | Richard Rognlie / Sendmail Ninja / Gamerz.NET Lackey
\__/ \ | http://www.gamerz.net/~rrognlie <rrognlie at gamerz.net>
/ \__/ | Creator of pbmserv at gamerz.net
\__/ | Helping reduce world productivity since 1994
More information about the Novalug
mailing list