masync help

This commit is contained in:
Amber 2021-06-14 17:09:11 +02:00
parent 3bf8209811
commit 27d42b7cb6

24
masync
View File

@ -33,11 +33,26 @@ myhelp() {
echo "Usage: ${HELP_CMD_NAME} {COMMAND} [OPTION]"
echo 'Description: '
echo -e '\tThis tool allows you to mirror and keep synchronised one or more folders on a remote server with arbitraries local folders.'
echo -e '\tIt has three main commands init, start, stop, remove'
echo -e '\tIt has six main commands init, list, start, stop, remove'
echo -e "\tNOTE: Before using it, you must have configured ssh on your remote server!"
echo -e "\tthe typical use is to start a sync with the command"
echo 'INIT: '
echo -e "\tTypical use of tool is starting a sync with the command"
echo -e "\t\t${HELP_CMD_NAME} init -l ${HELP_LOCAL_DIR} -r ${HELP_REMOTE_DIR}"
echo -e "\tAbove command starts to mirror and sync the local folder ${HELP_LOCAL_DIR} with the remote folder ${HELP_REMOTE_DIR}"
echo -e "\t-l option stands for the local folder you want to mirror and sync, -r option stands for the remote folder in the form known to both ssh and scp"
echo 'LIST: '
echo -e "\tit shows the list of all synched local folders with respective remote folder and some other usefull information: the integer id assigned to the sync,"
echo -e "\tthe current status of sync, the local folder you are keeping in sync and the remote folder."
echo -e "\tIn the following command you can refer the sync to apply the command with the integer id of sync using the option -s,"
echo -e "\tor with the local folder using the option -l"
echo 'STOP: '
echo -e "\tIf you want to stop a sync in the list of syncs, you can refer to it either by its id or by the local folder associated with the sync"
echo -e "\t\t${HELP_CMD_NAME} stop -s 1 or ${HELP_CMD_NAME} stop -l ${HELP_LOCAL_DIR}"
echo 'START: '
echo -e "\tIf you want to resume a stopped sync in the list of syncs, you can refer to it either by its id or by the local folder associated with the sync"
echo -e "\t\t${HELP_CMD_NAME} start -s 1 or ${HELP_CMD_NAME} stop -l ${HELP_LOCAL_DIR}"
echo 'REMOVE: '
echo -e "\tRemove the sync from the list of all syncs, do not delete any local folder and data"
echo -e "\t\t${HELP_CMD_NAME} remove -s 1 or ${HELP_CMD_NAME} stop -l ${HELP_LOCAL_DIR}"
}
hastrailingslash() {
@ -285,11 +300,8 @@ case "$1" in
case "${option}" in
l) localsync=${OPTARG}
if [[ -d "$localsync" ]]; then
#echo "Sync this local folder: $2"
synce=$(syncexists ${localsync})
echo "sync exits? ${synce}"
if [ ${synce} = true ]; then
echo "Stopping Sync local folder ${localsync}"
stoploopsyncpath ${localsync}
else
echo -e "Can't stop local sync for folder ${RED}${localsync}${ENDCOLOR}. It is not in sync task, please before use init"