Actually i want to run my shell script at every time when a user login as well as at boot. i have tried using using crontab but it runs only at boot not at every login.so please tell me how to do this.
#crontab -e
@reboot /home/user/test.sh
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.
Sign up to join this communityActually i want to run my shell script at every time when a user login as well as at boot. i have tried using using crontab but it runs only at boot not at every login.so please tell me how to do this.
#crontab -e
@reboot /home/user/test.sh
You can add your script in ~/.bash_profile
where ~
represents the homedir of the user for which running the script is intended.
/etc/profile
or better still in an include such as /etc/profile.d/local.sh