licencing gplv3
This commit is contained in:
parent
73011c3593
commit
44909815cd
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*swp
|
20
.synccmd.sh
20
.synccmd.sh
@ -1,7 +1,23 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# Copyright 2021 Luca Paris
|
||||||
|
#This file is part of masync.
|
||||||
|
|
||||||
|
#masync is free software: you can redistribute it and/or modify
|
||||||
|
#it under the terms of the GNU General Public License as published by
|
||||||
|
#the Free Software Foundation, either version 3 of the License, or
|
||||||
|
#(at your option) any later version.
|
||||||
|
|
||||||
|
#masync is distributed in the hope that it will be useful,
|
||||||
|
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
#GNU General Public License for more details.
|
||||||
|
|
||||||
|
#You should have received a copy of the GNU General Public License
|
||||||
|
#along with masync. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# $1 -> hash sync
|
# $1 -> hash sync
|
||||||
# $2 -> LOCAL PATH -> /home/luca/test/
|
# $2 -> LOCAL PATH
|
||||||
# $3 -> REMOTE PATH -> notanamber@myvps:/home/notanamber/sydir/ [avoid to copy remote in source]
|
# $3 -> REMOTE PATH -> user@myvps:/home/user/syncdir/ [trailing / avoids to copy remote folder in source]
|
||||||
sync() {
|
sync() {
|
||||||
src=$2
|
src=$2
|
||||||
dest=$3
|
dest=$3
|
||||||
|
@ -1,4 +1,20 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# Copyright 2021 Luca Paris
|
||||||
|
#This file is part of masync.
|
||||||
|
|
||||||
|
#masync is free software: you can redistribute it and/or modify
|
||||||
|
#it under the terms of the GNU General Public License as published by
|
||||||
|
#the Free Software Foundation, either version 3 of the License, or
|
||||||
|
#(at your option) any later version.
|
||||||
|
|
||||||
|
#masync is distributed in the hope that it will be useful,
|
||||||
|
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
#GNU General Public License for more details.
|
||||||
|
|
||||||
|
#You should have received a copy of the GNU General Public License
|
||||||
|
#along with masync. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
source ~/bin/.synccmd.sh
|
source ~/bin/.synccmd.sh
|
||||||
SYNCFILE=~/.syncdir.sync
|
SYNCFILE=~/.syncdir.sync
|
||||||
MYPID=$$
|
MYPID=$$
|
||||||
@ -9,16 +25,16 @@ RED="\e[31m"
|
|||||||
GREEN="\e[32m"
|
GREEN="\e[32m"
|
||||||
ENDCOLOR="\e[0m"
|
ENDCOLOR="\e[0m"
|
||||||
|
|
||||||
HELP_CMD_NAME='syncdir.sh'
|
HELP_CMD_NAME='masync'
|
||||||
HELP_LOCAL_DIR="/home/$USER/localsync/"
|
HELP_LOCAL_DIR="/home/$USER/localsync/"
|
||||||
HELP_REMOTE_DIR="remoteuser@server:/home/remoteuser/sync/"
|
HELP_REMOTE_DIR="remoteuser@server:/home/remoteuser/sync/"
|
||||||
|
|
||||||
myhelp() {
|
myhelp() {
|
||||||
echo "Usage: ${HELP_CMD_NAME} {COMMAND} [OPTION]"
|
echo "Usage: ${HELP_CMD_NAME} {COMMAND} [OPTION]"
|
||||||
echo 'Description: '
|
echo 'Description: '
|
||||||
echo -e '\tThis tool allows you to mirror and keep synchronised a folder on a remote server with an arbitrary local folder.'
|
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 three main commands init, start, stop, remove'
|
||||||
echo -e "\t${RED}NOTE: you must have configured ssh on your remote server!${ENDCOLOR}"
|
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 -e "\tthe typical use is to start a sync with the command"
|
||||||
echo -e "\t\t${HELP_CMD_NAME} init -l ${HELP_LOCAL_DIR} -r ${HELP_REMOTE_DIR}"
|
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 "\tAbove command starts to mirror and sync the local folder ${HELP_LOCAL_DIR} with the remote folder ${HELP_REMOTE_DIR}"
|
16
syncloop.sh
16
syncloop.sh
@ -1,4 +1,20 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# Copyright 2021 Luca Paris
|
||||||
|
#This file is part of masync.
|
||||||
|
|
||||||
|
#masync is free software: you can redistribute it and/or modify
|
||||||
|
#it under the terms of the GNU General Public License as published by
|
||||||
|
#the Free Software Foundation, either version 3 of the License, or
|
||||||
|
#(at your option) any later version.
|
||||||
|
|
||||||
|
#masync is distributed in the hope that it will be useful,
|
||||||
|
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
#GNU General Public License for more details.
|
||||||
|
|
||||||
|
#You should have received a copy of the GNU General Public License
|
||||||
|
#along with masync. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
## REQUIREMENT
|
## REQUIREMENT
|
||||||
# apt-get install inotify-tools
|
# apt-get install inotify-tools
|
||||||
# @1 hash to retrieve sync
|
# @1 hash to retrieve sync
|
||||||
|
Loading…
x
Reference in New Issue
Block a user