Link to home
Start Free TrialLog in
Avatar of Soumen Roy
Soumen RoyFlag for India

asked on

How do I send an email from raspberry pi at user login?

Hello experts,

I want my raspberry pi to send me an email notification (on gmail) whenever an user logs in or logs out..

I tried running my script @reboot from crontab -e. The script runs well when tested, but cannot run at reboot or startup..

How do I get it working??

Thanks in advance.
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

For crontab jobs:

- set required env. variables e.g. PATH
- use full pathnames for files and folders
- redirect stdin, stdout & stderr
Avatar of Soumen Roy

ASKER

@omararfarid

I am new to Linux, so it was a bit tough for me to understand..

I have set full pathnames though.. Here is a snap of the script and the cronjob list.
d.jpg
SOLUTION
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you, I will try it and tell if it has been solved..
May I ask you what do you mean by "source your ~/.bash_profile ", please?

Regards,
Soumen
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That worked.

Thank you.

Sorry for such a late reply.
No problem :)