Project

General

Profile

« Previous | Next » 

Revision 13258

lib/sh/sync.sh: added db_snapshot()

View differences:

trunk/lib/sh/sync.sh
49 49
	src="$local_dir" dest="$remote_url" command put "$@"
50 50
}
51 51

  
52
db_snapshot() # usage: [live=] ctl=... from=... [to=...] db_snapshot
53
# ctl(cmd:{start|stop}): daemon controller that takes command param
54
{
55
	echo_func; kw_params live ctl from to; : "${ctl:?}" "${from:?}"
56
	local_export live="${live-1}"; local to="${to:-$from.bak}"
57
	sudo mkdir "$to"
58
	
59
	sudo "$ctl" stop
60
	prep_try; local_dir="$from" remote_url="$to" inplace=1 "try" sudo upload
61
		# inplace: for large files, don't re-copy entire file
62
	sudo "$ctl" start
63
	rethrow
64
}
65

  
52 66
fi

Also available in: Unified diff