Script is executed when user logout
Hello guys,
Could anybody help me create a script that moves the files and directory from the user home directory to /usr/local/. this should get executed when the user logout.point me to a similar one I can modify, or indeed write one for me a script that will move files when user logout. Regards, karthi |
That isn't what /usr/local is for. Why do you want to move a users files? The /home directory is the place for a regular users files. /usr/local is where programs you build yourself often gets installed. It has a similar hierarchy structure as the the root directory and /usr.
|
No the server is located remotely. l have to update the remote server web applications so the programmer has to upload the to user's home directory so that i can able to get the file's eventually files copied through script when user's get logout.if there is any other idea plz specify me
Regards, karthi |
If the shell used is bash, then if there is a ~/.bash_logout script, it will be run. This script won't have write permission to /usr/local, so you might want to create a directory in /home/ just for storing the files.
See the info bash manual. The ~/.bash_logout is run when an interactive shell is exited. That is what the login shell is. However a user might be using a different shell. |
ya the plan of running script is not possible unless i gave full permission to access /usr/local is there any other way so that i can place upload file to that directory.please help me solve this situation.
|
Hi,
Gives us some more details. Also it is very easy to move the files provided user have permission to do so, but this way you will end up having very insecure application, which is updated arbitrarily with out testing. There are couple of methods for the job you are looking for
In case if it is an development environment; then probably you need a SVN or CVS server, a staging server - for testing, and then the production server. regards |
Hello guys,
Here the my requirements: i have to secure my ssh for remote login.so i have blocked the remote login and allowed a user to login in remote and from there using sudo command changing to root user. Now the problem is the programmer have to update the web applications (java runs in tomcat ) so he uses the graphical ssh to upload the files but here the files are stored in the user's home directory. so those files has to be 'moved' to the /usr/local where the jakarta folder when the logout. then the higher offical can able to use those files for deploying in live server. but every time the user uploads and logs out the above scenario has to be processed. If any further lockout information mention it and help me. |
why not just put user in sudoers file with restriction to only run file move script?
|
i haven't tried with those sudoers thank you for idea and the new things i am going to work. If you helped me to study those things i can proceed to do things with you help.
thanks karthi26 |
Read & enjoy: http://www.gratisoft.us/sudo/man/sudoers.html :)
|
:) Thanks a lot.... for you all :study:
|
All times are GMT -5. The time now is 08:38 PM. |