Skip to content

Instantly share code, notes, and snippets.

@unbelauscht
Created March 24, 2022 15:41
Show Gist options
  • Save unbelauscht/598f1d2e2e0afe89b83a57cd3d7fb120 to your computer and use it in GitHub Desktop.
Save unbelauscht/598f1d2e2e0afe89b83a57cd3d7fb120 to your computer and use it in GitHub Desktop.
fix nextcloud invalid modification time issues
#!/bin/bash
files=`find . -newermt "0000-12-31 23:59:59" ! -newermt "1970-00-01 23:59:59"`
for filename in $files; do
touch -a -m "${filename}"
done
# You need to run
# php occ files:scan --all
# to reindex your files to your DB.
# see: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#file-operations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment