Skip to content

Commit

Permalink
nc-datadir: move .opcache location too
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed May 27, 2017
1 parent 2a58cc2 commit b428b0f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion etc/nextcloudpi-config.d/nc-automount.sh
Expand Up @@ -27,7 +27,7 @@ show_info()
on boot or at the moment of insertion.
Format your drive as ext4 in order to move NC datafolder or database
VFAT or NTFS is not recommended and will not work without hackery
VFAT or NTFS is not recommended for this task, as it does not suport permissions
IMPORTANT: halt or umount the drive before extracting" \
20 90
Expand Down
5 changes: 5 additions & 0 deletions etc/nextcloudpi-config.d/nc-datadir.sh
Expand Up @@ -30,6 +30,7 @@ because they do not provide a compatible user/permissions system" \

configure()
{
## CHECKS
local SRCDIR=$( cd /var/www/nextcloud; sudo -u www-data php occ config:system:get datadirectory )
[ -d $SRCDIR ] || { echo -e "data directory $SRCDIR not found"; return 1; }

Expand All @@ -51,6 +52,7 @@ configure()
[[ $( stat -fc%d / ) == $( stat -fc%d $BASEDIR ) ]] && \
echo -e "INFO: moving data dir to another place in the same SD card\nIf you want to use an external mount, make sure it is properly set up"

## COPY
service apache2 stop

cp -ra "$SRCDIR" "$DATADIR_" || return 1
Expand All @@ -60,6 +62,9 @@ configure()
chown www-data:www-data "$DATADIR_/tmp"
sed -i "s|^;\?upload_tmp_dir =.*$|upload_tmp_dir = $DATADIR_/tmp|" /etc/php/7.0/fpm/php.ini

# opcache dir
sed -i "s|^opcache.file_cache=.*|opcache.file_cache=$DATADIR_/.opcache|" /etc/php/7.0/mods-available/opcache.ini

# datadir
cd /var/www/nextcloud
sudo -u www-data php occ config:system:set datadirectory --value=$DATADIR_
Expand Down

0 comments on commit b428b0f

Please sign in to comment.