You are not logged in.

#1 2008-07-25 04:58:36

jonrd
Member
From: USA-GA
Registered: 2008-06-28
Posts: 6

How can I make a file server sync with a laptop when it connectsSOLVED

Ok, first let me say that I looked on the Internet for this but didn't find what I was looking for. I'm going to be setting up a simple file server for my in laws soon...they use windows so I'll be using samba on the server side.

They have 3 computers and want to be able to have all there files stored in one central place so they can share them easily and also have them backed up at the same time. They have 2 desktops and one laptop.
The desktops are not a big deal to sync with the server because they are on all the time and I can just use a cron job or something. Then problem is the laptop..

What can I do to make the laptop automatically sync when it gets on the network? 
The catch is this needs to be ran from the server side so they have a "hands free" experience or whatever. If you know a way for the laptop to do this in the background I guess that would work too.

I know this is probably a very simple task but so far everything I find the user would have to manually start the sync.

Thanks in advance for you help!

Last edited by jonrd (2008-07-27 04:28:57)

Offline

#2 2008-07-25 14:11:45

zenlord
Member
From: Belgium
Registered: 2006-05-24
Posts: 1,221
Website

Re: How can I make a file server sync with a laptop when it connectsSOLVED

Is it necessary that all the files are on the local hard disks? In the case of the laptop I could understand this if the laptop is also used outside the network, but the desktops should stay in place, no?

It could be as easy as to make a shortcut on all the computers to the samba-share and tell the inlaws that they have to use the samba-share to store their (shared) files.

For backup-purposes, you could attach an external HD to the server and run a cronjob to backup the files in the share.

Zl.

Offline

#3 2008-07-25 15:31:19

Endperform
Member
From: Atlanta GA, USA
Registered: 2007-09-04
Posts: 94
Website

Re: How can I make a file server sync with a laptop when it connectsSOLVED

Assuming the laptop is always going to be in the same IP address when it connects to the network (which is unlikely in default configurations), you could create a script that checks for the existence of the machine on the network then perform a sync.  I had a script written in Python somewhere that would check to make sure the server side was up and run unison, but it could be modified to check for the laptop and copy files.  Let me know if that's something you're interested in and I can post it for you.

Offline

#4 2008-07-26 03:08:34

jonrd
Member
From: USA-GA
Registered: 2008-06-28
Posts: 6

Re: How can I make a file server sync with a laptop when it connectsSOLVED

Is it necessary that all the files are on the local hard disks? In the case of the laptop I could understand this if the laptop is also used outside the network, but the desktops should stay in place, no?

It could be as easy as to make a shortcut on all the computers to the samba-share and tell the inlaws that they have to use the samba-share to store their (shared) files.

You are correct about this but I doubt they would remember to use this all the time so I want to sync the folders just in case.

Assuming the laptop is always going to be in the same IP address when it connects to the network (which is unlikely in default configurations), you could create a script that checks for the existence of the machine on the network then perform a sync.  I had a script written in Python somewhere that would check to make sure the server side was up and run unison, but it could be modified to check for the laptop and copy files.  Let me know if that's something you're interested in and I can post it for you.

This sounds like what I'm looking for. Also I wander If it could be done by NetBIOS  name instead of ip address? This way It wouldn't matter.

The script sounds like what I'm looking for though smile

Thanks for the help!

Offline

#5 2008-07-26 05:12:55

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: How can I make a file server sync with a laptop when it connectsSOLVED

jonrd wrote:

Is it necessary that all the files are on the local hard disks? In the case of the laptop I could understand this if the laptop is also used outside the network, but the desktops should stay in place, no?

It could be as easy as to make a shortcut on all the computers to the samba-share and tell the inlaws that they have to use the samba-share to store their (shared) files.

You are correct about this but I doubt they would remember to use this all the time so I want to sync the folders just in case.

You can "move" the 'My Documents' folder to point to the Samba server - this is how we did the file server for 60-odd staff at my old work... Mapped \\server\home to H:\ then pointed 'My Documents' to H:\

On the laptop side of things, could you use Bacula (which has a Windows client) to backup the local machine to the server?

Offline

#6 2008-07-27 04:27:54

jonrd
Member
From: USA-GA
Registered: 2008-06-28
Posts: 6

Re: How can I make a file server sync with a laptop when it connectsSOLVED

That sounds like good idea. I'll check out the Bacula thing later. Between Bacula and remapping the folder that should be all I need.

Thanks for all the help!!

Offline

#7 2008-07-27 07:03:35

abhidg
Member
From: City of Kol
Registered: 2006-07-01
Posts: 184
Website

Re: How can I make a file server sync with a laptop when it connectsSOLVED

Also netcfg2 has a post_up option which allows you to run
any script after a particular connection has been established,
eg in my /etc/network.d/home:

POST_UP="cp /etc/hosts.home /etc/hosts"
POST_DOWN="cp /etc/hosts.else /etc/hosts"

Offline

Board footer

Powered by FluxBB