import sys import os print sys.argv[1] filepath = os.path.abspath(sys.argv[1]) basepath = '/home/rgrp/svnroot/rgrp' if not basepath in filepath: print 'Error: %s not in rgrp svn' % filepath sys.exit(1) offset = filepath[len(basepath):] destbase = 'rpollock@thefactz.org:~/rgrp/' destpath = destbase + offset cmd = 'scp -r %s %s' % (filepath, destpath) print 'Executing %s' % cmd os.system(cmd)