John: Don't know if this helps, but I originally looked into this a few weeks ago, and was told "Don't do it." -- People don't consistently log off.
So, my solution was to create a background process ran on login that periodically rsync'd the users' files by putting a call to my bash script in /etc/X11/Xsession.d My application is much more advanced than yours, but you're welcome to it if you'd like. -Michael On Thu, Feb 12, 2009 at 6:51 PM, john <[email protected]> wrote: > > Hello all, > > I am trying to craft a script that moves files from users Desktops to > a network share which is mounted via NFS. I currently run this script > successfully at logon under Ubuntu Hardy 8.04 AMD 64. My clients are > built with the -ai386 option so they run in 32 bit mode. The working > verison of the script is sourced from /etc/X11/Xsession.d > > However I'd rather have this script run at log off, and I understand > that I need to run it from /opt/ltsp/i386/usr/lib/ldm/rc.d > > I've created a file called K99-CleanDesktop and I've re-rolled my > client image. But my script doesn't appear to run on logoff. I suspect > it's because I don't understand how to adapt this script correctly. > I've tried to grok section 15.5 from the LTSP Admin Manual > www.ltsp.org/~sbalneav/LTSPManual.pdf but I am sorry to say it's just > too terse for me to understand. > > I've pasted my script below with the hope that someone can tutor me > and help me get this working. > > Thanks!! > > John > > > > > > > > # K99-CleanDesktop > # Clean up from previous session > # > # Sweep all files from $HOME and $HOME/Desktop to $HOME/Desktop/ZDrive > # (ignores directories). > # Makes Desktop and ZDrive dir entries if needed. > # > > > > # Name of desktop itself > dt=$HOME/Desktop > > # Name of ZDrive on Desktop > zd=$dt/ZDrive > > # If the user created files in the home directory, rsync them > # to their Zdrive and remove the copy > for src in "$HOME" "$dt" > do > # Walk entries in this dir > cd $src > for x in * > do > # Only process *files* in this dir > if [ -f "$x" ] > then > # Calculate default destination > dest="$zd/$x" > > if [ -e "$dest" ] > then > rsync -avu "$x" "$dest" > rm -rf "$x" > else > cp "$x" "$dest" && rm -f "$x" > fi > fi > done > done > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise > -Strategies to boost innovation and cut costs with open source participation > -Receive a $600 discount off the registration fee with the source code: SFAD > http://p.sf.net/sfu/XcvMzF8H > _____________________________________________________________________ > Ltsp-discuss mailing list. To un-subscribe, or change prefs, goto: > https://lists.sourceforge.net/lists/listinfo/ltsp-discuss > For additional LTSP help, try #ltsp channel on irc.freenode.net -- Michael Blinn Director, IT Services People Places, Inc. --- CONFIDENTIALITY NOTICE: This message, and any attachments that may accompany it, contain information that is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential, or otherwise exempt from disclosure under applicable law. If the recipient of this message is not the intended recipient, any disclosure, copying, or other use of this communication or any of the information, which it contains is unauthorized and prohibited. If you have received this message in error, please notify the original sender by return mail and delete this message, along with any attachments, from your computer. Thank you. ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _____________________________________________________________________ Ltsp-discuss mailing list. To un-subscribe, or change prefs, goto: https://lists.sourceforge.net/lists/listinfo/ltsp-discuss For additional LTSP help, try #ltsp channel on irc.freenode.net
