create rsync mirror
This commit is contained in:
parent
9c4cce0f4e
commit
0345600e53
|
@ -30,6 +30,9 @@ function mirrorRepository() {
|
||||||
[Gg][Ii][Tt])
|
[Gg][Ii][Tt])
|
||||||
mirrorGit "${1}" "${3}" "${4}" && return 0
|
mirrorGit "${1}" "${3}" "${4}" && return 0
|
||||||
;;
|
;;
|
||||||
|
[Rr][Ss][Yy][Nn][Cc])
|
||||||
|
mirrorRsync "${1}" "${3}" "${4}" && return 0
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
printWarn "Tried to mirror data using unsupported protocol (${2})!"
|
printWarn "Tried to mirror data using unsupported protocol (${2})!"
|
||||||
;;
|
;;
|
||||||
|
@ -37,6 +40,20 @@ function mirrorRepository() {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
# Creates a local mirror of specified RSYNC repository
|
||||||
|
# Parameters: %dest_directory% %address% [%username%]
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
function mirrorRsync() {
|
||||||
|
local DIRECTORY="${1}"
|
||||||
|
local ADDRESS="${2}"
|
||||||
|
local USER="${3:-root}"
|
||||||
|
run "su ${USER} -s \"/bin/sh\" -c \"rsync --compress --devices --delete \
|
||||||
|
--links --perms --recursive --stats --timeout=${FETCHTIMEOUT} --times \
|
||||||
|
${ADDRESS} ${DIRECTORY}\""
|
||||||
|
return ${?}
|
||||||
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Prepares SSH Wrappers for use with unknown hosts (requires key authentication)
|
# Prepares SSH Wrappers for use with unknown hosts (requires key authentication)
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user