-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmpsync
executable file
·59 lines (43 loc) · 1.41 KB
/
mpsync
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#! /bin/bash
evtdry=""
del=""
del_ex=""
# ssh parameters are stored in
# ~/.ssh/config
if [[ "$3" = "dry" ]] || [[ "$2" = "dry" ]] || [[ "$1" = "dry" ]] ; then
evtdry="--dry-run "
fi
if [[ "$3" = "--delete" ]] || [[ "$2" = "--delete" ]] || [[ "$1" = "--delete" ]] ; then
del="--delete"
fi
if [[ "$3" = "--delete-excluded" ]] || [[ "$2" = "--delete-excluded" ]] || [[ "$1" = "--delete-excluded" ]] ; then
del_ex="--delete-excluded"
fi
if [[ "$1" = "pull" ]] ; then
sourcefolder="www.musikpunkt.ch/"
dest="/shared/sites/www.musikpunkt.ch"
rsync -avz --exclude-from=/usr/local/bin/scripts_walo/mpsync_exclude.txt $evtdry $del $del_ex --rsh=ssh [email protected]:$sourcefolder $dest
else
echo "Forbidden"
# dest="shopware.valentinoberson.ch"
# sourcefolder="/home/walo/code_the_web/shopware.valentinoberson.ch/"
# ACTION='rsync -avz $evtdry --rsh=ssh $sourcefolder [email protected]:/$dest'
#
# if [[ "$del" = "--delete" ]] ; then
#
# read -p "Deleting on a push rsync can broke the entire site. Are you sure? (Y/n) " -n 1 -r
# echo # (optional) move to a new line
# if [[ $REPLY =~ ^[Y]$ ]] ; then
#
# # rsync -avz $evtdry --rsh=ssh $sourcefolder [email protected]:/$dest $del
# rsync -avz $evtdry $sourcefolder [email protected]:/$dest $del
# else
# echo "Aborded"
#
# fi
#
# else
# rsync -avz $evtdry --rsh=ssh $sourcefolder [email protected]:/$dest
#
# fi
fi