Algunas recomendaciones que se pueden ver en el área administrativa de Nextcloud hacen referencia al comando occ, para aclarar:
El comando occ
es una herramienta de línea de comandos para Nextcloud que permite administrar y configurar tu instancia de Nextcloud. Aquí hay una guía básica sobre cómo usarlo:
1. Acceso a la línea de comandos
Para usar occ
, necesitas acceso a la línea de comandos del servidor donde está instalado Nextcloud. Esto generalmente se hace a través de SSH.
2. Ubicación del archivo occ
El archivo occ
se encuentra en el directorio raíz de la instalación de Nextcloud. Por ejemplo, si tu instalación de Nextcloud está en /var/www/nextcloud
, el archivo occ
estará en /var/www/nextcloud/occ
.
3. Ejecutar el comando occ
El comando occ
debe ejecutarse como el usuario web (usualmente www-data
en servidores Apache o Nginx en sistemas basados en Debian/Ubuntu).
Puedes ejecutar el comando occ
usando sudo -u www-data php occ
desde el directorio de Nextcloud. Aquí hay algunos ejemplos:
Listar todos los comandos disponibles:
cd /var/www/nextcloud
sudo -u www-data php occ list
Ver el estado de la instalación:
cd /var/www/nextcloud
sudo -u www-data php occ status
Habilitar una aplicación:
cd /var/www/nextcloud
sudo -u www-data php occ app:enable nombre_de_la_aplicacion
Deshabilitar una aplicación:
cd /var/www/nextcloud
sudo -u www-data php occ app:disable nombre_de_la_aplicacion
Realizar un escaneo de archivos:
cd /var/www/nextcloud
sudo -u www-data php occ files:scan --all
Configurar un parámetro:
cd /var/www/nextcloud
sudo -u www-data php occ config:system:set nombre_del_parametro --value="valor"
Crear un usuario:
cd /var/www/nextcloud
sudo -u www-data php occ user:add nombre_de_usuario
4. Uso común de comandos occ
Aquí tienes algunos de los comandos occ
más utilizados y sus funciones:
maintenance:mode
: Administrar el modo de mantenimiento.- Activar:
sudo -u www-data php occ maintenance:mode --on
- Desactivar:
sudo -u www-data php occ maintenance:mode --off
- Activar:
user:add
: Añadir un nuevo usuario.sudo -u www-data php occ user:add nombre_de_usuario
user:delete
: Eliminar un usuario existente.sudo -u www-data php occ user:delete nombre_de_usuario
log:tail
: Ver los últimos registros del log.sudo -u www-data php occ log:tail
db:add-missing-indices
: Añadir índices faltantes a la base de datos.sudo -u www-data php occ db:add-missing-indices
config:system:get
: Obtener un valor de configuración del sistema.sudo -u www-data php occ config:system:get nombre_del_parametro
config:system:set
: Establecer un valor de configuración del sistema.sudo -u www-data php occ config:system:set nombre_del_parametro --value="valor"
Fuente: openAI chat
$jmarior@server:~$ sudo -u www-data php occ db:add-missing-indices
Check indices of the share table.
Check indices of the filecache table.
Adding additional size index to the filecache table, this can take some time...
Filecache table updated successfully.
Adding additional path index to the filecache table, this can take some time...
Filecache table updated successfully.
Adding additional parent index to the filecache table, this can take some time...
Filecache table updated successfully.
Check indices of the twofactor_providers table.
Check indices of the login_flow_v2 table.
Check indices of the whats_new table.
Check indices of the cards table.
Check indices of the cards_properties table.
Check indices of the calendarobjects_props table.
Check indices of the schedulingobjects table.
Check indices of the oc_properties table.
Adding properties_pathonly_index index to the oc_properties table, this can take some time...
oc_properties table updated successfully.
Check indices of the oc_jobs table.
Adding job_lastcheck_reserved index to the oc_jobs table, this can take some time...
oc_properties table updated successfully.
Check indices of the oc_direct_edit table.
Adding direct_edit_timestamp index to the oc_direct_edit table, this can take some time...
oc_direct_edit table updated successfully.
Check indices of the oc_preferences table.
Adding preferences_app_key index to the oc_preferences table, this can take some time...
oc_properties table updated successfully.
Check indices of the oc_mounts table.
Adding mounts_class_index index to the oc_mounts table, this can take some time...
oc_mounts table updated successfully.
Adding mounts_user_root_path_index index to the oc_mounts table, this can take some time...
oc_mounts table updated successfully.
Check indices of the oc_systemtag_object_mapping table.
Adding systag_by_tagid index to the oc_systemtag_object_mapping table, this can take some time...
oc_systemtag_object_mapping table updated successfully.
Adding additional textstep_session index to the oc_text_steps table, this can take some time...
oc_text_steps table updated successfully.