kapperz Posted February 14, 2012 Share Posted February 14, 2012 I recently installed the mail and status package from unMenu (I'm using unRaid 4.7) and it's working great except for one thing. I get emails whenever a scheduled job runs. For instance, I use the "at" command to change my samba config to a limited read-only state after 30min of reloading samba to a open/write config. I'm being specific here because, I'm not sure if it's the samba reload or the scheduled task activating the email. It's not the status script, I'm fairly sure. How can I prevent this? Many Thanks. Quote Link to comment
Joe L. Posted February 14, 2012 Share Posted February 14, 2012 I recently installed the mail and status package from unMenu (I'm using unRaid 4.7) and it's working great except for one thing. I get emails whenever a scheduled job runs. For instance, I use the "at" command to change my samba config to a limited read-only state after 30min of reloading samba to a open/write config. I'm being specific here because, I'm not sure if it's the samba reload or the scheduled task activating the email. It's not the status script, I'm fairly sure. How can I prevent this? Many Thanks. At jobs will send mail only if there is output. Redirect all stdout and stderr output to /dev/null and there will be no mail. Quote Link to comment
kapperz Posted February 14, 2012 Author Share Posted February 14, 2012 Thanks! Something like this? at -f /boot/scripts/samba_restart.sh now +30 minutes &> /dev/null Quote Link to comment
Joe L. Posted February 15, 2012 Share Posted February 15, 2012 Thanks! Something like this? at -f /boot/scripts/samba_restart.sh now +30 minutes &> /dev/null never used the -f option, so I really don't know. I also never put the redirection after the & putting a command in the background. (Unless "&>" has a special meaning to the bash shell I'm not familiar with) You seem to have re-directed the output of the "at" command, not the command being executed, so odds are it will not work as you expected. Joe L. Quote Link to comment
kapperz Posted February 15, 2012 Author Share Posted February 15, 2012 I'm no bash expert, but &> redirects both stdout and stderr. The -f switch tells 'at' to run the file name when executed. I still get an email. Oh well, I will tackle this later. Quote Link to comment
Joe L. Posted February 15, 2012 Share Posted February 15, 2012 I'm no bash expert, but &> redirects both stdout and stderr. The -f switch tells 'at' to run the file name when executed. I still get an email. Oh well, I will tackle this later. I would so something like this: echo "/boot/scripts/samba_restart.sh 1>/dev/null 2>&1" | at now +30 minutes That way the redirection to /dev/null is applied to the command being invoked rather than the "at" command as you have it. Quote Link to comment
kapperz Posted February 17, 2012 Author Share Posted February 17, 2012 Seems to do the trick. Thanks Joe! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.