Skip to content

Commit

Permalink
armbian: fix cron permissions bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Jan 22, 2019
1 parent 0e062aa commit af426a5
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 8 deletions.
1 change: 1 addition & 0 deletions bin/ncp/BACKUPS/nc-backup-auto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ EOF
chmod +x /usr/local/bin/ncp-backup-auto

echo "0 3 */${BACKUPDAYS} * * root /usr/local/bin/ncp-backup-auto" > /etc/cron.d/ncp-backup-auto
chmod 644 /etc/cron.d/ncp-backup-auto
service cron restart

echo "automatic backups enabled"
Expand Down
1 change: 1 addition & 0 deletions bin/ncp/BACKUPS/nc-rsync-auto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ configure()
}

echo "0 5 */${SYNCDAYS} * * root /usr/bin/rsync -ax --delete \"$DATADIR\" \"$DESTINATION\"" > /etc/cron.d/ncp-rsync-auto
chmod 644 /etc/cron.d/ncp-rsync-auto
service cron restart

echo "automatic rsync enabled"
Expand Down
2 changes: 1 addition & 1 deletion bin/ncp/BACKUPS/nc-snapshot-auto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ configure()
/usr/local/bin/btrfs-snp $MOUNTPOINT weekly 4 604800 ../ncp-snapshots
/usr/local/bin/btrfs-snp $MOUNTPOINT monthly 12 2592000 ../ncp-snapshots
EOF
chmod +x /etc/cron.hourly/btrfs-snp
chmod 644 /etc/cron.hourly/btrfs-snp
echo "automatic snapshots enabled"
}

Expand Down
1 change: 1 addition & 0 deletions bin/ncp/BACKUPS/nc-snapshot-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ configure()
[[ "$COMPRESSION" == "yes" ]] && ZIP="-z"

echo "30 4 */${SYNCDAYS} * * root /usr/local/bin/btrfs-sync -qd $ZIP \"$SNAPDIR\" \"$DESTINATION\"" > /etc/cron.d/ncp-snapsync-auto
chmod 644 /etc/cron.d/ncp-snapsync-auto
service cron restart
echo "snapshot sync enabled"
}
Expand Down
2 changes: 1 addition & 1 deletion bin/ncp/CONFIG/nc-autoupdate-nc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if [[ \${PIPESTATUS[0]} -eq 0 ]]; then
fi
echo "" >> /var/log/ncp.log
EOF
chmod a+x /etc/cron.daily/ncp-autoupdate-nc
chmod 644 /etc/cron.daily/ncp-autoupdate-nc
echo "automatic Nextcloud updates enabled"
}

Expand Down
2 changes: 1 addition & 1 deletion bin/ncp/CONFIG/nc-autoupdate-ncp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if /usr/local/bin/ncp-test-updates; then
-l "NextCloudPi was updated to \$( cat /usr/local/etc/ncp-version )"
fi
EOF
chmod a+x /etc/cron.daily/ncp-autoupdate
chmod 644 /etc/cron.daily/ncp-autoupdate
echo "automatic NextCloudPi updates enabled"
}

Expand Down
1 change: 1 addition & 0 deletions bin/ncp/CONFIG/nc-notify-updates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ EOF

# check every hour at 40th minute
echo "40 */${CHECKINTERVAL} * * * root /usr/local/bin/ncp-notify-update && /usr/local/bin/ncp-notify-unattended-upgrade" > /etc/cron.d/ncp-notify-updates
chmod 644 /etc/cron.d/ncp-notify-updates
[[ -f /run/crond.pid ]] && service cron restart

echo "update web notifications enabled"
Expand Down
1 change: 1 addition & 0 deletions bin/ncp/CONFIG/nc-scan-auto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ configure()
fi

echo "${MINS} ${HOUR} ${DAYS} * * root /usr/local/bin/ncp-scan" > /etc/cron.d/ncp-scan-auto
chmod 644 /etc/cron.d/ncp-scan-auto
service cron restart

echo "automatic scans enabled"
Expand Down
2 changes: 1 addition & 1 deletion bin/ncp/NETWORKING/duckDNS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ configure()
touch $CRONFILE
echo "*/5 * * * * root $INSTALLPATH/duck.sh >/dev/null 2>&1" > "$CRONFILE"
chmod 700 "$INSTALLPATH"/duck.sh
chmod +x "$CRONFILE"
chmod 644 "$CRONFILE"

# First-time execution of duck script
"$INSTALLPATH"/duck.sh > /dev/null 2>&1
Expand Down
1 change: 1 addition & 0 deletions bin/ncp/NETWORKING/freeDNS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ EOF
chmod +744 /usr/local/bin/freedns.sh

echo "*/${UPDATEINTERVAL} * * * * root /bin/bash /usr/local/bin/freedns.sh" > /etc/cron.d/freeDNS
chmod 644 /etc/cron.d/freeDNS
service cron restart

cd /var/www/nextcloud
Expand Down
2 changes: 1 addition & 1 deletion bin/ncp/NETWORKING/spDYN.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ configure()
# Adds file to cron to run script for DNS record updates and change permissions
touch $CRONFILE
echo "10 * * * * root $INSTALLPATH/spdnsUpdater.sh $DOMAIN $TOKEN $IPv6 >/dev/null 2>&1" > "$CRONFILE"
chmod +x "$CRONFILE"
chmod 644 "$CRONFILE"

# First-time execution of update script and print response from spdns.de server
"$INSTALLPATH"/spdnsUpdater.sh "$DOMAIN" "$TOKEN" "$IPv6"
Expand Down
14 changes: 11 additions & 3 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@

[v1.4.1](https://github.com/nextcloud/nextcloudpi/commit/9e0c100) (2019-01-16) docker: support for ncp-update-nc
[v1.4.4](https://github.com/nextcloud/nextcloudpi/commit/a5db49d) (2019-01-22) armbian: fix cron permissions bug

[v1.4.0](https://github.com/nextcloud/nextcloudpi/commit/1dd1bb7) (2019-01-16) add nc-trusted-domains
[v1.4.3](https://github.com/nextcloud/nextcloudpi/commit/0e062aa) (2019-01-21) dnsmasq: detect IP from config file (#782)

[v1.4.2 ](https://github.com/nextcloud/nextcloudpi/commit/57728e2) (2019-01-21) Proposed fix for issue #773 (#781)

[v1.4.1 ](https://github.com/nextcloud/nextcloudpi/commit/d0ca44a) (2019-01-16) docker: support for ncp-update-nc

[v1.4.0 ](https://github.com/nextcloud/nextcloudpi/commit/1dd1bb7) (2019-01-16) add nc-trusted-domains

[v1.3.12 ](https://github.com/nextcloud/nextcloudpi/commit/1f11d40) (2019-01-16) add public IP to trusted domains

[v1.3.11 ](https://github.com/nextcloud/nextcloudpi/commit/84ac075) (2019-01-16) nc-backup: parallel compression

Expand All @@ -13,7 +21,7 @@

[v1.3.7 ](https://github.com/nextcloud/nextcloudpi/commit/2ac9b8b) (2019-01-14) ncp-web: allow private IPv6 addresses

[v1.3.6](https://github.com/nextcloud/nextcloudpi/commit/34cba9f) (2019-01-14) nc-automount: add delays to some services in a persistent way
[v1.3.6 ](https://github.com/nextcloud/nextcloudpi/commit/34cba9f) (2019-01-14) nc-automount: add delays to some services in a persistent way

[v1.3.5 ](https://github.com/nextcloud/nextcloudpi/commit/6fb9c9b) (2019-01-14) nc-hdd-test: try to detect device type if auto doesnt work

Expand Down
3 changes: 3 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ done
ncc config:system:set trusted_domains 1 --value=$ip
EOF

# fix Armbian cron bug
chmod 644 /etc/cron.daily/* /etc/cron.d/* /etc/cron.hourly/*

# remove redundant opcache configuration. Leave until update bug is fixed -> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815968
# Bug #416 reappeared after we moved to php7.2 and debian buster packages. (keep last)
[[ "$( ls -l /etc/php/7.2/fpm/conf.d/*-opcache.ini | wc -l )" -gt 1 ]] && rm "$( ls /etc/php/7.2/fpm/conf.d/*-opcache.ini | tail -1 )"
Expand Down

0 comments on commit af426a5

Please sign in to comment.