Welcome to mirror list, hosted at ThFree Co, Russian Federation.

fix_invalid_modification_time.sh « addons - github.com/nextcloud/vm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 544ba99e3c927c8d1e6696fbee61963fabd6753d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash

# T&M Hansson IT AB © - 2022, https://www.hanssonit.se/

true
SCRIPT_NAME="Fix 'Could not update metadata due to invalid modified time'."
# shellcheck source=lib.sh
source /var/scripts/fetch_lib.sh

# Check if root
root_check

msg_box "This is an attempt to automate a fix for the nasty bug from the Desktop Client:
https://github.com/nextcloud/desktop/wiki/How-to-fix-the-error-invalid-or-negative-modification-date#-how-to-fix-it

Please only run this if you made a backup."

if ! yesno_box_no "Have you made a backup?"
then
    exit 1
fi

msg_box "OK, let's go! 

Please note, this script might take several hours to run, depening on the size of your datadir. Don't abort it!"

# Download the script
curl_to_dir https://raw.githubusercontent.com/nextcloud-gmbh/mtime_fixer_tool_kit/master solvable_files.sh $NCPATH

# Run all the needed variables
ncdb

if [[ $NCDBTYPE = mysql ]]
then
    msg_box "We only support PostgreSQL, sorry!"
    exit
fi

# Run the script and remove it
print_text_in_color "$ICyan" "Running the scan and fixing broken files..."
bash "$NCPATH"/solvable_files.sh "$NCDATA" "$NCDBTYPE" "$NCDBHOST" "$NCDBUSER" "$NCDBPASS" "$NCDB" fix use_birthday verbose
rm "$NCPATH"/solvable_files.sh

# Scan all files
nextcloud_occ files:scan --all