开发者

Script to logout user and perform background task

I'm trying to find a 开发者_JS百科way when a user logs in the system to automatically log off and perform a background script.

Specifically I will need to remove the local user account but keep the home folder in place. This will only need to be done once but I'm not sure of the best approach. The purpose of logging in once is to capture the account that is used, however as long as they are logged in the account cannot be deleted.

All of the system are either Mac OS X 10.5.8 OR 10.6.


You can acheive this using .bash_logout script. From bash's manual page:

When a login shell exits, bash reads and executes commands from the file ~/.bash_logout, if it exists.


ur question is ambigious....

Automatically logging off can be done by loginhook....make one that sets a timer to certain time and then gives the log off command....

If u make the account a guest account... its contents will automatically be deleted once the user logs out... So i would suggest that make a guest account, using sudo command, make a loginhook....that will automatically logout user after the timer expires and since it is a guest account, all information will be deleted.,..

only thing left is capture...for that use a usb, run a script that copies the concerned folders to usb... hope this helps

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜