GithubHelp home page GithubHelp logo

claucambra / mtime_fixer_tool_kit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nextcloud-gmbh/mtime_fixer_tool_kit

0.0 0.0 0.0 44 KB

Tool kit to fix the mtime issue on the server state

Shell 100.00%

mtime_fixer_tool_kit's Introduction

mtime correction tool kit

solvable_files.sh

This script looks for problematic files on the server's file system.

The default behavior is to simply list the solvable files.

To fix the files mtime on both the file system and the database, you have to call the script with the fix argument at the end of the argument list.

Checks

The mtime from the file system and from the database must be equal to proceed.

To find the file's mtime from the database, a username is derived from the file's path, this allow use to find the correct storage, file on the database.

Group folders are handled specially by checking if the username equal __groupfolders.

Actions

  • The file's mtime will be updated with the touch command.
  • An occ files:scan will be run on the file to update the database.

Limitations

  • Files that are not present on the server's file system will not be fixed. For example files on an external storage.

Usage

./solvable_files.sh <data_dir> <mysql|pgsql> <db_host> <db_user> <db_pwd> <db_name> [<fix|list>] [<scan|noscan>]

Output

$ ./solvable_files.sh "$PWD/data/" mysql localhost nextcloud password nextcloud list noscan
/home/louis/workspace/nextcloud/server/data/__groupfolders/1/(test).md
/home/louis/workspace/nextcloud/server/data/__groupfolders/1/test".md
/home/louis/workspace/nextcloud/server/data/__groupfolders/1/test.md
/home/louis/workspace/nextcloud/server/data/alice/files_trashbin/files/storage trash.d1639576034/(test).md
/home/louis/workspace/nextcloud/server/data/alice/files_trashbin/files/storage trash.d1639576034/test".md
/home/louis/workspace/nextcloud/server/data/alice/files_trashbin/files/storage trash.d1639576034/test.md
/home/louis/workspace/nextcloud/server/data/admin/files/welcome.txt
/home/louis/workspace/nextcloud/server/data/admin/files/shared test/(test).md
/home/louis/workspace/nextcloud/server/data/admin/files/shared test/test".md
/home/louis/workspace/nextcloud/server/data/admin/files/shared test/test.md
$ ./server/mtime_scripts/solvable_files.sh "$PWD/server/data/" mysql localhost nextcloud password nextcloud list noscan | wc -l
10

unsolvable_files.sh

This script lists files that can not be fixed by the solvable_files.sh script. For example files on an external storage.

It compares files found in the database with files found in on the server's file system and prints the diff.

Usage

./unsolvable_files.sh <data_dir> <mysql|pgsql> <db_host> <db_user> <db_pwd> <db_name>

Output

$ ./unsolvable_files.sh "$PWD/data/" mysql localhost nextcloud password nextcloud
local::/home/louis/nextcloud_external//(test).md
local::/home/louis/nextcloud_external//test".md
local::/home/louis/nextcloud_external//test.md
$ ./unsolvable_files.sh "$PWD/data/" mysql localhost nextcloud password nextcloud | wc -l
3

fix_group_folders.sh

This script will simulate a scan for files located in the groupfolder's trash and version folders.

Usage

./fix_group_folders.sh <data_dir> <mysql|pgsql> <db_host> <db_user> <db_pwd> <db_name>

Output

./fix_group_folders.sh "$PWD/data/" mysql localhost nextcloud password nextcloud

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.