Skip to content

Commit d8e6c2b

Browse files
committed
2 parents ca9ce49 + adab47e commit d8e6c2b

2 files changed

Lines changed: 10 additions & 22 deletions

File tree

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ That's it! Visit your website and enjoy the latest version of Nextcloud!
2323

2424

2525
# Usage
26-
Simply change lines 22 - 34 to suit your needs:
26+
Simply change lines 22 - 35 to suit your needs:
2727
```
2828
# Directories - change the following lines to suit your needs
2929
html=/var/www/html # root html directory
@@ -48,8 +48,11 @@ chmod +x ./ncupdate.sh
4848
```
4949
By default, the script will leave the folders "data", "config", "apps" and "themes" within your nextcloud path. <br />
5050
That's usefull for example if you have mass data and copying data to another folder would take too long..<br />
51+
5152
You can enable a file backup (copy data files to another folder) by starting the script with "-b" option:<br />
52-
``./ncupdate.sh -b`` or ``./ncupdate.sh --backup``
53+
``./ncupdate.sh -b``<br />
54+
"-d" enables backup of external data directory, e.g. it's stored in ``/home/data``:<br />
55+
``./ncupdate.sh -bd /home/data``
5356

5457
## Notes
5558
* Tested on CentOS 6.8 & 7.3

ncupdate.sh

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ echo "make a new, fresh installation and then restore your data from backup."
161161
echo
162162
echo "Checking versions in 5 seconds.."
163163

164+
progress_bar() {
164165
echo -ne ' |====> | (20%)\r'
165166
sleep 1
166167
echo -ne ' |=======> | (40%)\r'
@@ -171,6 +172,8 @@ echo -ne ' |===============> | (80%)\r'
171172
sleep 1
172173
echo -ne ' |===================>| (100%)\r'
173174
echo -ne '\n'
175+
}
176+
progress_bar
174177

175178
# Check if new version is larger than current version installed.
176179
function version_gt() { local v1 v2 IFS=.; read -ra v1 <<< "$1"; read -ra v2 <<< "$2"; printf -v v1 %03d "${v1[@]}"; printf -v v2 %03d "${v2[@]}"; [[ $v1 > $v2 ]]; }
@@ -199,16 +202,7 @@ else
199202
fi
200203
echo "Press CTRL+C to abort."
201204

202-
printf " |===> | (20%%)\r"
203-
sleep 1
204-
printf " |=======> | (40%%)\r"
205-
sleep 1
206-
printf " |===========> | (60%%)\r"
207-
sleep 1
208-
printf " |===============> | (80%%)\r"
209-
sleep 1
210-
printf " |===================>| (100%%)\r"
211-
printf "\n"
205+
progress_bar
212206

213207
if [[ "$backupenabled" == "true" ]]; then
214208
# Backup data
@@ -395,16 +389,7 @@ fi
395389
echo "Removing old Nextcloud files in 5 seconds..."
396390
fi
397391

398-
echo -ne ' |====> | (20%)\r'
399-
sleep 1
400-
echo -ne ' |=======> | (40%)\r'
401-
sleep 1
402-
echo -ne ' |===========> | (60%)\r'
403-
sleep 1
404-
echo -ne ' |===============> | (80%)\r'
405-
sleep 1
406-
echo -ne ' |===================>| (100%)\r'
407-
echo -ne '\n'
392+
progress_bar
408393

409394
if [[ "$backupenabled" == "true" ]]; then
410395
rm -rf $ncpath

0 commit comments

Comments
 (0)