Talk:Incremental and Static Backups with git and rsync

From FachschaftSprachwissenschaft
Revision as of 21:08, 9 July 2008 by Aleks (Talk | contribs)

Jump to: navigation, search

Gee, thanks a million, Aleks! Kilian 04:34, 5 July 2008 (CEST)

It ain't finished yet, hold on. I'll try to finish it soon. I'm still working on the python script to put it all together. I'm currently using a zsh-script. Here it is in case you can make sense of it:

DATEFMT="%a, %b %d (%V) | %H:%M.%S"



export SSH_AGENT_PID=$(pgrep ssh-agent)
export SSH_AUTH_SOCK=$(ls /tmp/ssh-*/*)




printlog() {
	print "\n$1 on $(date +$DATEFMT)\n" >>| $LOGFILE;

dorsync() {
	for d in $rsyncdirs; do
		cd "$d";
		printlog "Processing directory $d";
		rsync -vax --numeric-ids --bwlimit=8000 --ignore-existing\
		--size-only . $target_host:/"$d" >>| $LOGFILE 2>&1;

gitpush() {
	for d in $gitdirs; do
		cd "$d";
		printlog "Processing directory $d";
		git-push --all ssh://payak/$(pwd) >>| $LOGFILE 2>&1;

printlog "Starting backup from $this_host to $target_host"

printlog "Backing up static content from $this_host to $target_host"
printlog "Backing up tracked content from $this_host to $target_host"

printlog "Finished backup from $this_host to $target_host"

The reason we need to specify my current projects in gitdirs is that git doesn't track nested git repos. This makes sense if you think about it, but it also forces you to back them up manually. Admin 11:24, 5 July 2008 (CEST)

About the shell prompts...

I don't know if adding shell prompts really is a good idea. People copy them into their commands and for me the prompt looks very different. Prompts just make it more difficult to copy & paste and some people think that they're part of the command. But... Maybe that's also a good thing... dunno.

Admin 22:08, 9 July 2008 (CEST)