Nextcloud - synchronization problem - incorrect file modification time

I’m having an issue with files not updating properly when syncing files. using the script that fixes it. What tools invoke scripts when used in syncloud (database, host, user, password etc)?

Sript fIle solvable_files.sh form GitHub - nextcloud-gmbh/mtime_fixer_tool_kit: Tool kit to fix the mtime issue on the server state

Have not tried that one, but from the parameters you can try these:

./solvable_files.sh /data/nextcloud pgsql /var/snap/nextcloud/current/database nextcloud nextcloud nextcloud list

It will probably not work as we use db ubix socket instead of tcp, but let’s see the error message.

Also why do you need it? Is it because arm32 board of buggy version of nextcloud client broke them in past?

The file modification dates were corrupted by a desktop application error. The year of modification was set at 1970.

Here are the errors after executing the script:

./solvable_files.sh: line 7: syntax error near unexpected token `newline'
./solvable_files.sh: line 7: `<!DOCTYPE html>'

I found another solution. I changed the date of the files on the local drive and the sync errors disappeared. Here is the script that fixed the date:

#!/bin/bash

function change_mtime() {
    touch -t 202410010000 "$1"
}

directory="directory path"

find "$directory" -type f -or -type d -mtime +0 | while read file; do
    year=$(date -r "$file" +%Y)

    # Jeśli rok to 1970, zmieniamy datę modyfikacji
    if [ "$year" -eq 2024 ] && [ "$month" -eq 10 ] && [ "$day" -eq 25 ]; then
        change_mtime "$file"
        echo "Change date for: $file"
    fi
done

1 Like