[SOLVED] How to turn off Jobs email


Recommended Posts

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.

Link to comment

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.
Link to comment

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.

Link to comment

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.

 

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.