echo "${PROG_NAME} -- synchronisation serveur RSYNC"
echo "Usage: ${PROG_NAME} [OPTIONS...] MODE"
echo
+ echo "Options:"
+ echo " -l liste de répertoires (défaut = RSYNC_LIST du fichier de config.)"
+ echo
echo "MODE:"
echo " push"
echo " pull"
echo
}
-while getopts "h" flag ;do
+while getopts "l:h" flag ;do
case ${flag} in
h)
print_usage
exit 0
;;
+ l)
+ rsync_list="${OPTARG}"
+ ;;
?)
echo "${PROG_NAME}: Invalid option: ${OPTARG}."
echo "Try \`${PROG_NAME} -h' for more information."
source ${HVRSYNC_CONF}
+if [ "${rsync_list}" = "" ]; then
+ rsync_list="${RSYNC_LIST}"
+fi
+
# rsync options:
# -a: sync recursively and preserves symbolic links, special and device
# files, modification times, groups, owners, and permissions.
# -n: dry-run
-for f in ${RSYNC_LIST}; do
+for f in ${rsync_list}; do
if [ x"${mode}" = x"diff" ]; then
if [ ! -d ${RSYNC_LOCAL_DIR}/${f} ]; then