Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2019-05-11 20:10:21 +0300
committernachoparker <nacho@ownyourbits.com>2019-05-11 20:14:19 +0300
commitd9384817c2a14f0889d30bebb89e40a6cb78217c (patch)
tree74ca4e9ad40be3619962af35f78b1b85ad1593d3
parent758908128a0837304f54e58846b3e3ae4bb29cb0 (diff)
nc-scan-auto: recursive and home-only optionsv1.12.3
Signed-off-by: nachoparker <nacho@ownyourbits.com>
-rw-r--r--bin/ncp/CONFIG/nc-scan-auto.sh11
-rw-r--r--bin/ncp/TOOLS/nc-scan.sh27
-rw-r--r--changelog.md10
-rw-r--r--etc/ncp-config.d/nc-scan-auto.cfg12
4 files changed, 47 insertions, 13 deletions
diff --git a/bin/ncp/CONFIG/nc-scan-auto.sh b/bin/ncp/CONFIG/nc-scan-auto.sh
index 9236b033..1445d7fc 100644
--- a/bin/ncp/CONFIG/nc-scan-auto.sh
+++ b/bin/ncp/CONFIG/nc-scan-auto.sh
@@ -32,17 +32,20 @@ configure()
[[ $hour == 0 ]] && hour="*" || { hour="*/$hour" mins="15"; }
fi
+ [[ "$RECURSIVE" == no ]] && local recursive=--shallow
+ [[ "$NONEXTERNAL" == yes ]] && local non_external=--home-only
+
cat > /usr/local/bin/ncp-scan-auto <<EOF
#!/bin/bash
(
echo -e "\n[ nc-scan-auto ]"
- [[ "$PATH1" != "" ]] && /usr/local/bin/ncc files:scan -n -v -p "$PATH1"
- [[ "$PATH2" != "" ]] && /usr/local/bin/ncc files:scan -n -v -p "$PATH2"
- [[ "$PATH3" != "" ]] && /usr/local/bin/ncc files:scan -n -v -p "$PATH3"
+ [[ "$PATH1" != "" ]] && /usr/local/bin/ncc files:scan $recursive $non_external -n -v -p "$PATH1"
+ [[ "$PATH2" != "" ]] && /usr/local/bin/ncc files:scan $recursive $non_external -n -v -p "$PATH2"
+ [[ "$PATH3" != "" ]] && /usr/local/bin/ncc files:scan $recursive $non_external -n -v -p "$PATH3"
- [[ "${PATH1}${PATH2}${PATH3}" == "" ]] && /usr/local/bin/ncc files:scan -n -v --all
+ [[ "${PATH1}${PATH2}${PATH3}" == "" ]] && /usr/local/bin/ncc files:scan $recursive $non_external -n -v --all
) 2>&1 >>/var/log/ncp.log
EOF
diff --git a/bin/ncp/TOOLS/nc-scan.sh b/bin/ncp/TOOLS/nc-scan.sh
index 394bb53c..219c016e 100644
--- a/bin/ncp/TOOLS/nc-scan.sh
+++ b/bin/ncp/TOOLS/nc-scan.sh
@@ -9,8 +9,8 @@
#
-install()
-{
+install()
+{
cat > /usr/local/bin/ncp-scan <<'EOF'
#!/bin/bash
ncc files:scan -n -v --all
@@ -18,21 +18,34 @@ EOF
chmod +x /usr/local/bin/ncp-scan
}
-configure()
+configure()
{
+ local ret=0
+
[[ "$RECURSIVE" == no ]] && local recursive=--shallow
[[ "$NONEXTERNAL" == yes ]] && local non_external=--home-only
- [[ "$PATH1" != "" ]] && \
+ [[ "$PATH1" != "" ]] && {
ncc files:scan -n -v $recursive $non_external -p "$PATH1"
+ [[ $? -ne 0 ]] && ret=1
+ }
- [[ "$PATH2" != "" ]] && \
+ [[ "$PATH2" != "" ]] && {
ncc files:scan -n -v $recursive $non_external -p "$PATH2"
+ [[ $? -ne 0 ]] && ret=1
+ }
- [[ "$PATH3" != "" ]] && \
+ [[ "$PATH3" != "" ]] && {
ncc files:scan -n -v $recursive $non_external -p "$PATH3"
+ [[ $? -ne 0 ]] && ret=1
+ }
+
+ [[ "${PATH1}${PATH2}${PATH3}" == "" ]] && {
+ ncc files:scan -n -v $recursive $non_external --all
+ [[ $? -ne 0 ]] && ret=1
+ }
- [[ "${PATH1}${PATH2}${PATH3}" == "" ]] && ncc files:scan -n -v --all
+ return ${ret}
}
# License
diff --git a/changelog.md b/changelog.md
index c73e18ca..ad014978 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,7 +1,13 @@
-[v1.12.0](https://github.com/nextcloud/nextcloudpi/commit/703ff6f) (2019-04-29) ncp-web: add backups panel
+[v1.12.3](https://github.com/nextcloud/nextcloudpi/commit/b797129) (2019-05-11) nc-scan-auto: recursive and home-only options
-[v1.11.5](https://github.com/nextcloud/nextcloudpi/commit/01cd421) (2019-04-29) letsencrypt: force renewal by default
+[v1.12.2 ](https://github.com/nextcloud/nextcloudpi/commit/7589081) (2019-05-11) fix logrotate files
+
+[v1.12.1](https://github.com/nextcloud/nextcloudpi/commit/1be5ddd) (2019-05-01) Rename configuration variables into self-documenting ones (#889)
+
+[v1.12.0](https://github.com/nextcloud/nextcloudpi/commit/f34354c) (2019-04-29) ncp-web: add backups panel
+
+[v1.11.5 ](https://github.com/nextcloud/nextcloudpi/commit/01cd421) (2019-04-29) letsencrypt: force renewal by default
[v1.11.4 ](https://github.com/nextcloud/nextcloudpi/commit/b3c7d13) (2019-04-28) letsencrypt: switch to apt version
diff --git a/etc/ncp-config.d/nc-scan-auto.cfg b/etc/ncp-config.d/nc-scan-auto.cfg
index 780e2247..d931de96 100644
--- a/etc/ncp-config.d/nc-scan-auto.cfg
+++ b/etc/ncp-config.d/nc-scan-auto.cfg
@@ -13,6 +13,18 @@
"type": "bool"
},
{
+ "id": "RECURSIVE",
+ "name": "Recursive",
+ "value": "yes",
+ "type": "bool"
+ },
+ {
+ "id": "NONEXTERNAL",
+ "name": "Ignore external files",
+ "value": "no",
+ "type": "bool"
+ },
+ {
"id": "SCANINTERVAL",
"name": "Scan periodicity (in minutes)",
"value": "60",