bash script running by cron
Is there anything wrong with this bash script that would cause it not to work correctly?
Code:
$ crontab -l |
I would write a nice bash script, test that one from the command line and once it works, call that batch script from cron. Execute with
Code:
sh -x yourscript jlinkels |
I agree with jlinkels, so here's my :twocents:
Code:
#!/bin/bash |
Thank both of you for the information. I followed the advice, and here is what I have now.
Code:
$ crontab -l |
What jlinkels meant is to write a script, test it by sh -x for debugging, then put the script in crontab (instead of the long list of commands to execute). Anyway, sh -x give a trace of all the commands executed from the shell and there is no reason to put it in a cron job. Regarding mail recipient, by default the cron daemon sends mails to the owner of the crontab, but you can always specify the recipient by assigning the MAILTO variable at the beginning of your crontab, e.g.
Code:
MAILTO=colucix |
Emails are being sent to my username. They are being sent to chris@gmail.com. chris is my username, but that is not my gmail account. Here is my sSMTP configuration.
Code:
$ cat /etc/ssmtp/ssmtp.conf http://img530.imageshack.us/my.php?i...ronjobaij7.png Here is the guide that gives this invalid configuration. http://people.aapt.net.au/~adjlstrong/mutt.html |
Hi,
My deepest apologies if a guide written by me has lead you astray. Can I ask if this you exact ssmtp.conf file? In which case you may need to modify the following values: Quote:
Code:
root=Email Address # Your email address http://ubuntuforums.org/showthread.php?t=565326 There are multiple sites giving roughly the same configuration for ssmtp and gmail: http://gentoo-wiki.com/HOWTO_Gmail_and_sSMTP http://wiki.zhekov.net/ssmtpgmail http://writingitdown.wordpress.com/2...utt-for-gmail/ I have not included directions for cron jobs on this or any of my pages as the potential for errors is just too great. Please let me know if this resolves the issue, Andrew |
My username and password are correct. I just choose not to give that information out to everyone. I am currently configuring Postfix.
|
Hi,
Quote:
Can any other readers of this forum see the errors here? Andrew |
I am supposed to choose mbox or Maildir for Postfix. Does anyone know what fetchmail uses? I think mbox. Should my answer be the same as what Fetchmail uses?
|
Andrew,
Do you not think Sendmail or Postfix would be a better solution? I believe I'd learn a lot more from them, and they are much more capable. |
I cannot be of much help with SMTP configuration, but regarding the issue about crontab you may consider to use MAILTO= with the complete e-mail address.
|
Quote:
|
Quote:
|
Quote:
|
All times are GMT -5. The time now is 10:59 AM. |