I’m using Nextcloud since some weeks now, and I would like making a backup of it thanks this tutorial. The thing is I got this :
root@localhost:~# sudo -u www-data php occ maintenance:mode --on
Could not open input file: occ
root@localhost:~# cd /var/www/
root@localhost:/var/www# dir
html
I already searched on the forum a solution of : Could not open input file: occ, and it seems for a majority of people it’s a permission problem. But for me, I don’t even have the Nextcloud folder !
since you are using snap: do it the snapway. read the manual and use the include cli utilities
most of the people didn’t seem to be aware that occ is a file read by the php command and therefore you have to supply the full path to it or be in the correct directory before you execute php
As you can see, I’m a noob and still discovering stuff and trying to understand how it works.
First, I tried the php method with your command line, and I get this in return :
root@localhost:~# sudo -u www-data php /snap/nextcloud/26119/bin/occ maintenance:mode --on
# shellcheck source=src/mysql/utilities/mysql-utilities
. "$SNAP/utilities/mysql-utilities"
# shellcheck source=src/php/utilities/php-utilities
. "$SNAP/utilities/php-utilities"
# shellcheck source=src/redis/utilities/redis-utilities
. "$SNAP/utilities/redis-utilities"
# shellcheck source=src/nextcloud/utilities/nextcloud-utilities
. "$SNAP/utilities/nextcloud-utilities"
if [ "$(id -u)" -ne 0 ]; then
echo "This utility needs to run as root"
exit 1
fi
wait_for_php
wait_for_redis
wait_for_nextcloud_to_be_configured
run-php "$SNAP/htdocs/occ" "$@"
I don’t really understand what I’m reading tho… haha
Second, you’re telling me to do it the snapway, I don’t know how to put the server in maintenance mode with snap command, and if I still can follow the step of the backup tutorial !
NB : I’m super happy that in your short manuel, it explains how to change HTTP port, I never found how to do it, so I changed the PiHole admin panel port from 80 to 81 haha !
of course you could follow the “official backup tutorial”. but it won’t match out-of-the-box. you have to understand what you have to backup (data, config, database) and where to find it in the snap folders.