@@ -72,28 +72,49 @@ rakeBackup() {
7272rsyncUp () {
7373# rsync up with default key
7474 echo =============================================================
75- echo -e " Start rsync to \n$remoteServer :$remoteDest \ndefault key"
76- echo =============================================================
75+ echo -e " Start rsync to \n$remoteServer :$remoteDest \ndefault key\n"
7776 rsync -Cavz --delete-after -e " ssh -p$remotePort " $gitRakeBackups / $remoteUser @$remoteServer :$remoteDest
7877}
7978
8079rsyncKey () {
8180# rsync up with specific key
8281 echo =============================================================
83- echo -e " Start rsync to \n$remoteServer :$remoteDest \nwith specific key"
84- echo =============================================================
82+ echo -e " Start rsync to \n$remoteServer :$remoteDest \nwith specific key\n"
8583 rsync -Cavz --delete-after -e " ssh -i $sshKeyPath -p$remotePort " $gitRakeBackups / $remoteUser @$remoteServer :$remoteDest
8684}
8785
8886rsyncDaemon () {
8987# rsync up with specific key
9088 echo =============================================================
91- echo -e " Start rsync to \n$remoteUser @$remoteServer :$remoteModule \nin daemon mode"
92- echo =============================================================
89+ echo -e " Start rsync to \n$remoteUser @$remoteServer :$remoteModule \nin daemon mode\n"
9390 rsync -Cavz --port=$remotePort --password-file=$rsync_password_file --delete-after /$gitRakeBackups / $remoteUser @$remoteServer ::$remoteModule
9491
9592}
9693
94+ sshQuotaKey () {
95+ # quota check: with a key remoteServer, run the quota command
96+ if [[ $checkQuota == " true" || $checkQuota = 1 ]]
97+ then
98+ echo =============================================================
99+ echo -e " Quota check: \n$remoteUser @$remoteServer :$remoteModule \nwith key\n"
100+ ssh -p $remotePort -i $sshKeyPath $remoteUser @$remoteServer " quota"
101+ echo =============================================================
102+
103+ fi
104+ }
105+
106+ sshQuota () {
107+ # quota check: assuming we can ssh into remoteServer, run the quota command
108+ if [[ $checkQuota == " true" || $checkQuota = 1 ]]
109+ then
110+ echo =============================================================
111+ echo -e " Quota check: \n$remoteUser @$remoteServer :$remoteModule \n"
112+ ssh -p $remotePort $remoteUser @$remoteServer " quota"
113+ echo =============================================================
114+
115+ fi
116+ }
117+
97118printScriptver () {
98119 # print the most recent tag
99120 echo " This is $0 "
@@ -125,16 +146,17 @@ cd $PDIR
125146if [[ $remoteModule != " " ]]
126147then
127148 rsyncDaemon
128-
149+
129150# no Daemon so lets see if we are using a special key
130151else if [ -e $sshKeyPath -a -r $sshKeyPath ] && [[ $sshKeyPath != " " ]]
131152 then
132-
133153 rsyncKey
134- else if [[ $remoteServer != " " ]]
135- then
136- # use the defualt
137- rsyncUp
154+ sshQuotaKey
155+ else if [[ $remoteServer != " " ]]
156+ then
157+ # use the defualt
158+ rsyncUp
159+ sshQuota
138160 fi
139161 fi
140162fi
0 commit comments