Using rsync with django

Just a quick warning/tip on using Django with rsync, for other people pulling their hair out later.

When you use rsync a good way to get a directory is using rsync -aCq, which means recursively, quietly, move a directory ignoring common files. The -a command means 'archive'; keep permissions and as much data about the files as possible. We use -C because it ignores .pyc and .svn files. However, in the list of included files is 'core', so that you don't move over core dumps.

Django however has a core directory inside of it, and using -C causes rsync to ignore that directory. So we ended up using the rsync command like so:

rsync -aCq --include=core

Hopefully this saves people some time trying to rsync Django in the future. I'd be curious what other rsync commands that people use for moving around django and/or other files.




Comments

1 Patrick Taylor says...

Thanks! I've been playing around with rsync and would probably have been tearing out what little hair I have left if I hadn't seen this.

Posted at 10:58 p.m. on January 29, 2009

2 Paul says...

What a funny little collision. Good catch!

Posted at 7:41 p.m. on January 30, 2009

3 Jordi Funollet says...

Almost the same, but with a lot of include/exclude on a hidden file:

rsync -avzh -C --delete -f '. ./.rsync-filter'

This is easy to customize for every project and you can have files and dirs not replied. And force the 'django/core/' dir.

Posted at 6:46 p.m. on February 1, 2009

Comments support markdown

Comments are closed.

Comments have been close for this post.