rsync is your friend. I don't remember whether rsync is installed by default. I tend to use rsync over ssh (safer, very easy), for that you need the openssh daemon running - let's say on your desktop.
On your desktop, then:
Code:
sudo apt-get install rsync openssh-server
On your notebook:
Code:
sudo apt-get install rsync
Because the ssh server is now running on your desktop, you'll need to run rsync commands from your laptop. From very safe (never overwrite anything newer) up to very exact (make sure the two trees are 100% the same):
1. Never overwrite anything on the desktop that looks more recent; never delete in general
Code:
notebookuser@notebook:~$ rsync -e ssh -avzP --update /on/notebook/documentdir desktopuser@ip-of-desktop:/on/desktop/
This synchronizes /on/notebook/documentdir with all its subfolders to /on/desktop/documentdir. If nothing was there before it comes down to a copy. Be careful with directory names in rsync: best to always have source dir
without a / appended, and destination parent dir
with a / appended. If usernames on notebook and desktop are the same you can leave the desktopuser@ part out. Use either the IP address of the desktop, or if you have working dns, the name.
2. Sync everything from notebook to desktop including files that look newer on the desktop, but don't delete stuff
Code:
notebookuser@notebook:~$ rsync -e ssh -avzP /on/notebook/documentdir desktopuser@ip-of-desktop:/on/desktop/
3. Sync the tree completely, make the desktop dir a clone of the notebook one. Delete files on the desktop that don't exist on the notebook.
Code:
notebookuser@notebook:~$ rsync -e ssh -avzP --delete /on/notebook/documentdir desktopuser@ip-of-desktop:/on/desktop/
4. Paranoid mode: Be even more exact and don't trust file modification times and sizes; read and compare all blocks on both sides and make absolutely sure the clone doesn't have any imperfections. This can be a lot slower. Also potentially delete stuff, like in (3).
Code:
notebookuser@notebook:~$ rsync -e ssh -avzP --checksum --delete /on/notebook/documentdir desktopuser@ip-of-desktop:/on/desktop/
If you want to do this every day/week whatever, you would have to make it a crontab entry, with the slight complication of needing a trusted key without password (private key on notebook in ~/.ssh, public key on desktop in ~/.ssh/authorized_keys).
Hope this helps - Bert.