====== Nettoyage de Nextcloud ======
Se rendre dans le répertoire de nextcloud
cd /var/www/html/nextcloud
Puis :
sudo -u www-data php occ versions:cleanup
sudo -u www-data php occ trashbin:cleanup --all-users
sudo -u www-data php occ files:cleanup
Ou pour tout faire à la fois :
sudo -u www-data php occ versions:cleanup && sudo -u www-data php occ trashbin:cleanup --all-users && sudo -u www-data php occ files:cleanup
===== MAJ sans passer par le webupdater et sans passer par l'étape "backup" particulièrement chronophage (et sans interaction : ne pose aucune question) =====
sudo -u www-data php /path/to/nextcloud/updater/updater.phar --no-backup --no-interaction
===== Ajout d'index manquant suite à MAJ =====
La base de données a quelques index manquants. L'ajout d'index dans de grandes tables peut prendre un certain temps. Elles ne sont donc pas ajoutées automatiquement. En exécutant "occ db:add-missing-indices", ces index manquants pourront être ajoutés manuellement pendant que l'instance continue de tourner. Une fois les index ajoutés, les requêtes sur ces tables sont généralement beaucoup plus rapides.
sudo -u www-data php occ db:add-missing-indices
===== Activer le mode maintenance =====
Si besoin seulement (après un update pour une conversion de type de champ en BDD par exemple) :
sudo -u www-data php occ maintenance:mode --on
sudo -u www-data php occ maintenance:mode --off
===== Erreur ROW_FORMAT =====
En cas d'avertissement : "Format de ligne incorrect trouvé dans votre base de donnéées. ROW_FORMAT=Dynamic offre les meilleures performances de base de données pour Nextcloud. Veuillez modifier le format de ligne dans la liste"
Voir le sujet : https://help.nextcloud.com/t/upgrade-to-nextcloud-hub-10-31-0-0-incorrect-row-format-found-in-your-database/218366/33
Requête maison (Qui permet de lister facilement les tables concernées, mais n'applique curieusement pas l'alter table) :
SELECT CONCAT('ALTER TABLE \`', TABLE_NAME, '\` ROW_FORMAT=DYNAMIC;')
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = "nxcloud"
AND ROW_FORMAT!="Dynamic"
AND TABLE_NAME IN ('oc_authorized_groups', 'oc_preferences', 'oc_passwords_password_rv', 'oc_oauth2_access_tokens', 'oc_recent_contact', 'oc_cospend_projects', 'oc_profile_config', 'oc_cospend_members', 'oc_circles_circles', 'oc_twofactor_providers', 'oc_activity_mq', 'oc_duplicatefinder_finfo', 'oc_properties', 'oc_user_transfer_owner', 'oc_text_steps', 'oc_shares_limits', 'oc_retention', 'oc_collres_resources', 'oc_flow_operations_scope', 'oc_maps_device_points', 'oc_text_sessions', 'oc_external_config', 'oc_circle_circles', 'oc_systemtag_object_mapping', 'oc_mimetypes', 'oc_accounts_data', 'oc_phonetrack_filtersb', 'oc_maps_photos', 'oc_gpxpod_tracks', 'oc_duplicatefinder_dups', 'oc_direct_edit', 'oc_circles_links', 'oc_circle_groups', 'oc_calendar_resources', 'oc_polls_comments', 'oc_vcategory_to_object', 'oc_notes_meta', 'oc_circle_gsshares', 'oc_passwords_registration', 'oc_text_documents', 'oc_phonetrack_shares', 'oc_phonetrack_points', 'oc_federated_reshares', 'oc_jobs', 'oc_flowupload_directories', 'oc_group_admin', 'oc_group_folders_acl', 'oc_passwords_tag', 'oc_passwords_pw_tag_rel', 'oc_notifications', 'oc_circles_clouds', 'oc_storages_credentials', 'oc_external_mounts', 'oc_group_folders_groups', 'oc_passwords_folder', 'oc_migrations', 'oc_group_user', 'oc_circle_clouds', 'oc_passwords_keychain', 'oc_appconfig', 'oc_external_options', 'oc_duplicatefinder_dups_f', 'oc_oauth2_clients', 'oc_cospend_paymentmodes', 'oc_polls_polls', 'oc_phonetrack_geofences', 'oc_dav_shares', 'oc_passwords_tag_rv', 'oc_circles_groups', 'oc_known_users', 'oc_ratelimit_entries', 'oc_addressbooks', 'oc_maps_address_geo', 'oc_flow_checks', 'oc_trusted_servers', 'oc_calendar_appt_bookings', 'oc_polls_notif', 'oc_maps_devices', 'oc_accounts', 'oc_cospend_currencies', 'oc_share_external', 'oc_vcategory', 'oc_passwords_password', 'oc_twofactor_backupcodes', 'oc_gpxedit_options', 'oc_calendarchanges', 'oc_authtoken', 'oc_circle_members', 'oc_phonetrack_pubshares', 'oc_share', 'oc_polls_votes', 'oc_maps_favorites', 'oc_schedulingobjects', 'oc_reader_bookmarks', 'oc_phonetrack_tileserver', 'oc_bruteforce_attempts', 'oc_calendarobjects', 'oc_passwords_share', 'oc_activity', 'oc_gpxpod_pictures', 'oc_calendar_rooms', 'oc_calendars', 'oc_cospend_bill_owers', 'oc_gpxmotion_tile_server', 'oc_directlink', 'oc_circle_gsevents', 'oc_dav_cal_proxy', 'oc_polls_preferences', 'oc_polls_log', 'oc_cospend_shares', 'oc_circle_links', 'oc_reader_prefs', 'oc_passwords_challenge', 'oc_announcements', 'oc_circles_tokens', 'oc_flow_operations', 'oc_cards_properties', 'oc_filecache', 'oc_talk_sessions', 'oc_circle_gsshares_mp', 'oc_announcements_map', 'oc_calendar_resources_md', 'oc_group_folders_trash', 'oc_systemtag', 'oc_comments_read_markers', 'oc_addressbookchanges', 'oc_files_trash', 'oc_webauthn', 'oc_gpxmotion_options', 'oc_talk_commands', 'oc_phonetrack_devices', 'oc_talk_bridges', 'oc_cospend_bills', 'oc_filecache_extended', 'oc_calendar_invitations', 'oc_user_status', 'oc_notifications_pushhash', 'oc_circles_members', 'oc_maps_apikeys', 'oc_calendarsubscriptions', 'oc_storages', 'oc_ncdownloader_info', 'oc_privacy_admins', 'oc_maps_tracks', 'oc_cms_pico_websites', 'oc_notifications_settings', 'oc_talk_attendees', 'oc_cospend_categories', 'oc_polls_options', 'oc_talk_internalsignaling', 'oc_gpxpod_tile_servers', 'oc_polls_share', 'oc_phonetrack_proxims', 'oc_whats_new', 'oc_group_folders', 'oc_file_locks', 'oc_collres_accesscache', 'oc_calendar_appt_configs', 'oc_login_flow_v2', 'oc_gpxedit_tile_servers', 'oc_cards', 'oc_calendar_reminders', 'oc_collres_collections', 'oc_passwords_session', 'oc_gpxpod_directories', 'oc_mounts', 'oc_circles_shares', 'oc_group_folders_manage', 'oc_talk_rooms', 'oc_maps_favorite_shares', 'oc_calendarobjects_props', 'oc_systemtag_group', 'oc_passwords_folder_rv', 'oc_phonetrack_sessions', 'oc_calendar_rooms_md', 'oc_groups', 'oc_users', 'oc_comments', 'oc_circle_tokens', 'oc_circle_shares', 'oc_external_applicable')
Requête que j'ai finalement passé :
ALTER TABLE `oc_authorized_groups` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_preferences` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_passwords_password_rv` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_oauth2_access_tokens` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_recent_contact` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_cospend_projects` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_profile_config` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_cospend_members` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_circles_circles` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_twofactor_providers` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_activity_mq` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_duplicatefinder_finfo` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_properties` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_user_transfer_owner` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_text_steps` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_shares_limits` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_retention` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_collres_resources` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_flow_operations_scope` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_maps_device_points` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_text_sessions` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_external_config` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_circle_circles` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_systemtag_object_mapping` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_mimetypes` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_accounts_data` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_phonetrack_filtersb` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_maps_photos` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_gpxpod_tracks` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_duplicatefinder_dups` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_direct_edit` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_circles_links` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_circle_groups` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_calendar_resources` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_polls_comments` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_vcategory_to_object` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_notes_meta` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_circle_gsshares` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_passwords_registration` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_text_documents` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_phonetrack_shares` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_phonetrack_points` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_federated_reshares` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_jobs` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_flowupload_directories` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_group_admin` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_group_folders_acl` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_passwords_tag` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_passwords_pw_tag_rel` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_notifications` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_circles_clouds` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_storages_credentials` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_external_mounts` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_group_folders_groups` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_passwords_folder` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_migrations` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_group_user` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_circle_clouds` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_passwords_keychain` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_appconfig` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_external_options` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_duplicatefinder_dups_f` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_oauth2_clients` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_cospend_paymentmodes` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_polls_polls` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_phonetrack_geofences` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_dav_shares` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_passwords_tag_rv` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_circles_groups` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_known_users` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_ratelimit_entries` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_addressbooks` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_maps_address_geo` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_flow_checks` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_trusted_servers` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_calendar_appt_bookings` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_polls_notif` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_maps_devices` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_accounts` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_cospend_currencies` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_share_external` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_vcategory` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_passwords_password` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_twofactor_backupcodes` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_gpxedit_options` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_calendarchanges` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_authtoken` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_circle_members` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_phonetrack_pubshares` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_share` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_polls_votes` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_maps_favorites` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_schedulingobjects` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_reader_bookmarks` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_phonetrack_tileserver` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_bruteforce_attempts` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_calendarobjects` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_passwords_share` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_activity` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_gpxpod_pictures` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_calendar_rooms` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_calendars` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_cospend_bill_owers` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_gpxmotion_tile_server` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_directlink` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_circle_gsevents` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_dav_cal_proxy` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_polls_preferences` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_polls_log` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_cospend_shares` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_circle_links` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_reader_prefs` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_passwords_challenge` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_announcements` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_circles_tokens` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_flow_operations` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_cards_properties` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_filecache` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_talk_sessions` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_circle_gsshares_mp` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_announcements_map` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_calendar_resources_md` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_group_folders_trash` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_systemtag` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_comments_read_markers` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_addressbookchanges` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_files_trash` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_webauthn` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_gpxmotion_options` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_talk_commands` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_phonetrack_devices` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_talk_bridges` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_cospend_bills` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_filecache_extended` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_calendar_invitations` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_user_status` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_notifications_pushhash` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_circles_members` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_maps_apikeys` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_calendarsubscriptions` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_storages` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_ncdownloader_info` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_privacy_admins` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_maps_tracks` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_cms_pico_websites` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_notifications_settings` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_talk_attendees` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_cospend_categories` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_polls_options` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_talk_internalsignaling` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_gpxpod_tile_servers` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_polls_share` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_phonetrack_proxims` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_whats_new` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_group_folders` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_file_locks` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_collres_accesscache` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_calendar_appt_configs` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_login_flow_v2` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_gpxedit_tile_servers` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_cards` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_calendar_reminders` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_collres_collections` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_passwords_session` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_gpxpod_directories` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_mounts` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_circles_shares` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_group_folders_manage` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_talk_rooms` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_maps_favorite_shares` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_calendarobjects_props` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_systemtag_group` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_passwords_folder_rv` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_phonetrack_sessions` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_calendar_rooms_md` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_groups` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_users` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_comments` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_circle_tokens` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_circle_shares` ROW_FORMAT = DYNAMIC; ALTER TABLE `oc_external_applicable` ROW_FORMAT = DYNAMIC;
====== Ajout de fichiers directement sur le serveur ======
sudo rsync -av --stats --progress --delete /source /dest/nextcloud/data/UserName/files/Dossier/
Remplacer :
* source : par le dossier contenant les fichiers à ajouter
* UserName : par le compte qui recevra les fichiers
* Dossier : par le dossier de destination sur ce compte UserName
Puis lancer un scan avec OCC :
sudo -u www-data php occ files:scan UserName
Ou pour tous les utilisateurs :
sudo -u www-data php occ files:scan --all
Ou pour un chemin spécifique :
sudo -u www-data php occ files:scan --path="/UserName/files/Dossier"
====== Désactiver une application en ligne de commande ======
Se rendre dans le dossier de nextcloud pour utiliser occ.
Pour connaitre toutes les applications installées :
sudo -u www-data php occ app:list
Pour désactiver (et non pas désinstaller) l'application "NAME_OF_APP" :
sudo -u www-data php occ app:disable NAME_OF_APP
====== Miniatures (application "Preview Generator") ======
===== Générer toutes les miniatures **la première fois** =====
sudo -u www-data php occ preview:generate-all -vvv
Important: pour activer la génération d'image il faut ensuite ajouter un cronjob :
crontab -e
*/30 3 * * * sudo -u www-data php -f /PATH_TO_OCC/occ preview:pre-generate
===== Créer les miniatures pour un utilisateur ou un dossier spécifique =====
En remplaçant $USER et $DOSSIER
sudo -u www-data php occ preview:generate-all --path="$USER/files/$DOSSIER" -v
On peut même liste plusieurs répertoires chez plusieurs utilisateurs comme ceci :
sudo -u www-data php occ preview:generate-all --path="$USER/files/$DOSSIER " -v && sudo -u www-data php occ preview:generate-all --path="$USER2/files/$DOSSIER2 " -v
===== Créer les miniatures pour ce qui a été ajouté depuis le dernier lancement du cron =====
sudo -u www-data php occ preview:pre-generate
======= Maps - Photos =======
Trouvé sur : https://github.com/nextcloud/maps/issues/880
Pour ajouter les photos sur la carte si cela ne s'est pas fait correctement :
En le planifiant (plus long mais plus respectueux des ressources du serveur):
maps:scan-photos
ou en le forçant en ligne de commande avec "--now" (plus efficace et je n'ai pas eu de problème malgré les +200k de photos traitées en +/- 2H).
maps:scan-photos --now
======= Erreurs ImagickException =======
Trouvé sur : https://wiki.sitnikov.ga/doku.php?id=howto:nextcloud&s%5B%5D=imagickexception#solutions_for_imagickexceptions_in_nextcloudlog
En cas de lignes d'erreurs "ImagickException: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/421" dans le logfile (/var/nc_data/nextcloud.log , ou sur $SERVER/settings/admin/logging ) :
On fait un backup de la config avant de la modifier :
cp /etc/ImageMagick-6/policy.xml /etc/ImageMagick-6/policy.xml.bak && vi /etc/ImageMagick-6/policy.xml
J'ai juste modifié les droits de "none" à "read|write" pour la ligne pattern="PDF" comme ceci :
[...]
[...]
Puis on relance apache :
sudo /etc/init.d/apache2 restart
======= Erreur de synchronisation "date de modification incorrecte" =======
Perso j'ai fait :
touch -m --date=now '/PATH_TO_FILE/file.ext'
(pour mettre une date à NOW)
ou encore touch -m --date='20210204' '/PATH_TO_FILE/file.ext'
(pour définir une date)
Suivi d'un :
sudo -u www-data php occ files:scan --all -vvv
Pour traiter les fichiers par lot "plus ancien que 1971-01-01", il existe un script proposé sur :
https://help.nextcloud.com/t/client-desktop-mac-change-date-to-01-01-1970-after-download/129765/8
#!/bin/sh
IFS=$'\n'
FILES=$( find . -type f ! -newermt "1971-01-01" )
for FILE in $FILES; do
NEWTIME=$( stat -c %z "$FILE" )
echo "Setting '$FILE' to '$NEWTIME'"
touch -m --date="$NEWTIME" "$FILE"
done
====== Supprimer "index.php" des URL ======
https://help.nextcloud.com/t/removing-index-php-from-the-nextcloud-uri/13055/14
La solution peut aussi être trouvée dans la doc officielle de nextcloud : [[https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#proxy-configurations|Proxy Configurations 67]]
- Ajouter cette ligne dans [diossier racine de nextcloud]/config/config.php 'htaccess.RewriteBase' => '/',
(Si l'instance Nextcloud est accessible autrement qu'à la racine comme dans "https://mycloud.org/nextcloud" alors il faudra mettre "/nextcloud". Si Nextcloud est accessible via "https://mycloud.org/" alors il faut mettre "/".)
- Lancer cette commande pour mettre à jour le fichier .htaccess : sudo -u www-data php occ maintenance:update:htaccess