LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How I Made My Home Directory Syncronize Accross A Network, Is there A Better Way? (https://www.linuxquestions.org/questions/linux-networking-3/how-i-made-my-home-directory-syncronize-accross-a-network-is-there-a-better-way-514385/)

rmurdough 12-28-2006 02:04 PM

How I Made My Home Directory Syncronize Accross A Network, Is there A Better Way?
 
Hello, after hours of tinkering I finnaly made GDM rsync my home directory to a server on logout, and then rsync it back on login. This way my Home Directory is the same on every machine in the network. Does anyone have any improvements on my below method.

1. I first created a script called sync_home_down.sh in /etc/gdm/PreSession with the bellow contents:

RCOMMAND="rsync -avrzogtp -e ssh --safe-links p43200ht.rjmcomputer.com:/media/storage1/homes/$USER/ /home/$USER"
eval $RCOMMAND


then I added a line to the top of the Default script in the same directory:

/etc/gdm/PreSession/sync_home_down.sh


2. Next I created a script called sync_home_up.sh in /etc/gdm/PostSession with the bellow contents:

RCOMMAND="rsync -e ssh -avrzogtp --delete --safe-links --exclude=.Xauthority /home/$USER/ p43200ht.rjmcomputer.com:/media/storage1/homes/$USER"
eval $RCOMMAND


then I added a line to the bottom of the Default file in that directory

/etc/gdm/PostSession/sync_home_up.sh


I set it all up to use passwordless ssh under the root account, since gdm seems to like running these scripts as root.

Does anyone see a problem with this method, or know a better way?

Thanks

bitva 12-28-2006 02:26 PM

There's usually many ways to do anything on a nix system. I say the one that works is the right way. If your way works then that's the way. Having it run as root is probably the only red flag in your procedure but eh, it works.


All times are GMT -5. The time now is 10:51 AM.