Okay this must be a very general problem and I am sure there are clever solutions to it. I recently started to automatize a lot of my backup routines with #elisp and #emacs. What I am struggling with is that I constantly have to enter the password for every sudo command, so this is quite annoying. For the email I already use an authinfo file and somehow I should also be able to do that here too I just don't know how.