This page is powered by Blogger. Isn't yours? tech

qptech blog

The companion to qpmarl blog. Here you will find all technical related posts (mostly computer and linux stuff)

Monday, October 16, 2006

 

laptop sync

I wanted to be able to sync files on my desktop with my laptop. The files are accessable on the laptop over the network, but I want to have a local copy on the laptop for when I am away from my LAN and stuff.

I'm sure there's software out there to do this - probably even open source stuff with nice graphical interfaces and all. But I just wrote a simple shell script1 to do it.

The script looks for a file named .sourcedir in the current directory and reads it to figure out the source directory. The current directory is the destination. The script then copies the subdirectories from the source to the destination skipping existing files that haven't changed - so there is no wasted traffic. And it only copies directories that already exist in the destination directory. So if I have 3 directories in the source: movies, reading, and camera; and I want to sync reading and camera, but not movies because it's too freaking huge, I'd make the empty directories camera and reading - all sub directories of these would be created and filled. But movies would be skipped over entirely.

It's simple and it's not perfect, but it works.



1. I like the command prompt and writing shell scripts - it's actually faster when you get used to it and if you can type decently fast - more flexible too

Comments: Post a Comment

<< Home