Quote:
Originally Posted by
digitalrg
I placed #!/bin/bash, changed the `/path/to/script`, commented SCP and also i put in the return core it says " return code 2 "but no tar file has been created.. i dont know how to setup mail in Ubuntu...
You're saying when you ran the script off cron, it gave a return code of 2, but you don't know how to setup mail . . . So, how did you get the output with the return code?
Anyway, 2 is a fatal error. But it doesn't really tell us much. Are there no other errors in the output? Or are you not yet getting an email of the output? If not, do as ripat suggests with MAILTO in your crontab.
I assume you are using the same user account interactively as with crontab?
Did you comment out all three lines of your scp?
You might try doing a `set` at the beginning of the script (right after the #! line), so that you can see what your environment is and what the differences are between interactive and cron.
If you can't resolve it playing around with these ideas, you might want to post a simplified version (leaving out the commented stuff) and the messages it produces. Don't bother with all the `set` output, just check it for differences.